We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byLeonard Powers
Modified about 1 year ago
©NIIT Linux Basics Lesson 1B / Slide 1 of 26 Introduction to Linux Pre-Assessment Questions 1.Identify the service that Windows operating systems use to share files and printers. a.Samba b.CRON Scheduler c.Web Server d.Licensing 2.Identify the default shell for most Linux systems. a. Tcsh b. A c. Z d. Bash
©NIIT Linux Basics Lesson 1B / Slide 2 of 26 Introduction to Linux Pre-Assessment Questions 3.The output, Aug, is being displayed on the screen. Identify the command that has generated this output. a.date "+%a" b.date "+%h" c.date "+%y" d.date "+%r" 4.Which columns display the date and time information of the currently logged on users when the who command is executed? a.1, 2, and 3 b.2, 3, and 4 c.3, 4, and 5 d.1, 2, and 5
©NIIT Linux Basics Lesson 1B / Slide 3 of 26 Introduction to Linux Pre-Assessment Questions 5.Consider the following statements: Statement A: Kernel, the operating system program, is the core of the Linux system. Statement B: Shell is a collection of programs that services day-to-day processing requirements. Which of the following is correct with respect to the above statements? a.Statement A is True but Statement B is False. b.Statement A is False but Statement B is True. c.Both, Statement A and Statement B, are True. d.Both, Statement A and Statement B, are False.
©NIIT Linux Basics Introduction to Linux Lesson 1B / Slide 4 of 26 Solutions to Pre-Assessment Questions 1.a. Samba 2.d. Bash 3.b. date "+%h“ 4.c. 3, 4, and 5 5.a. Statement A is True but Statement B is False
©NIIT Linux Basics Lesson 1B / Slide 5 of 26 Introduction to Linux Objectives In this lesson, you will learn to: Identify the Linux file hierarchy structure Specify absolute and relative pathnames Identify types of files and users in Linux Change the current directory and list its content Create and remove a directory Display the content of a file Copy, rename, move, or remove a file Determine and assign file access permissions
©NIIT Linux Basics Lesson 1B / Slide 6 of 26 Introduction to Linux The Linux File System Linux follows the Unix file system which is a hierarchical, inverted-tree like structure. All the files are stored on the disk under / (root) directory. The directory, /, contains following directories: /bin : Stores commands available under the Linux system /dev : Stores all the device-related files for the system /etc : Stores the system-related data that the users and the system need to refer to, such as the passwd file /lib : Contains libraries of data for the compilers installed on the system, such as the C language routines /home : Contains all the home directories of users /usr : Stores the operating systems files not involved in the boot process /var : Stores information specific to different utilities of Linux
©NIIT Linux Basics Introduction to Linux The Linux File System (Contd.) A sample Linux file hierarchy structure Lesson 1B / Slide 7 of 26©NIIT Working with the Shell
©NIIT Linux Basics Lesson 1B / Slide 8 of 26 Introduction to Linux File Naming Conventions The filenames in Linux: Can be up to 256 characters long Can contain special characters, except for ‘/’ Can contain both upper-case and lower-case alphabets Are case-sensitive Should not have a blank or a tab
©NIIT Linux Basics Lesson 1B / Slide 9 of 26 Introduction to Linux Relative Path Names Linux takes the path name as absolute or relative. When the path name starts with a character, it is taken as the relative path name with respect to the current working directory. When the path name starts with ‘/’, it is taken as the absolute path name. To access the file, September 2004, under the /home/steve/baseball directory, Steve can specify the absolute path as /home/steve/baseball/September Alternatively, Steve can specify the relative path, baseball/September Relative path is a more convenient way to specify path names.
©NIIT Linux Basics Lesson 1B / Slide 10 of 26 Introduction to Linux Types of Files in Linux All information, including devices, is treated as a file in Linux. There are three categories of files: Ordinary files: Are created by a user and include all the data files, program files, object files, and executable files. Directory files: Are created automatically as a directory is created and contains information about the files under the directory. Special files: Are associated with input/output devices and are found in the standard Linux directories, such as /dev and /etc. Linux supports the following types of special files: Character device files: Read and write data one character at a time. Block device files: Access a block of data at a time. Hard links: Allow a single file to have multiple names. Symbolic links: Allow a single file to have multiple names across different file systems.
©NIIT Linux Basics Lesson 1B / Slide 11 of 26 Introduction to Linux Types of Users in Linux The following are the user types supported by Linux: System administrator: Is responsible for the smooth operation of the system including tasks, such as create users and groups and make backups. File owner: Is a user who creates a file and can perform any operation on the file, such as copying, deleting, and editing. Group owner: Is a user belonging to a group who can share and access the files. Other users: Are users who do not belong to a particular group.
©NIIT Linux Basics Lesson 1B / Slide 12 of 26 Introduction to Linux Directory Commands in Linux The commonly used directory commands in Linux are: pwd : Displays the full path name of the current directory: steve]$ pwd cd : Changes the current directory to the directory specified: steve]$ cd /usr/bin mkdir : Creates directories under a specified or current directory: steve]$ mkdir prog-files rmdir : Removes the specified directory: steve]$ rmdir prog-files ls : Displays the names of the files and subdirectories in a directory: steve]$ ls /home/steve
©NIIT Linux Basics Lesson 1B / Slide 13 of 26 Introduction to Linux Common File Commands The commonly used file commands in Linux are: cat : Displays the content of the specified file. steve]$ cat data1 cp : Duplicates the content of the source file into a target file. The syntax of the cp command is: steve]$ cp [options] rm : Deletes files. The syntax of the rm command is: steve]$ rm [options] file/s mv : Moves a file from one location to another. It can also be used for renaming a file. The syntax of the mv command is: steve]$ mv [option] source destination
©NIIT Linux Basics Lesson 1B / Slide 14 of 26 Introduction to Linux Common File Commands (Contd.) more : Displays data one screen-full at a time. The syntax of the more command is: steve]$ more [options] less : Displays data one screen-full at a time and allows you to scroll up while viewing the content of a file. The syntax of the less command is: steve]$ less [options]
©NIIT Linux Basics Lesson 1B / Slide 15 of 26 Introduction to Linux Wildcard Characters Using the wildcard characters, you can perform an operation on multiple files without specifying names of all the files. The following table lists the wildcards available in Linux: CharacterPurpose * Matches none or one character or a string of more than one character ? Matches exactly one character [ ] Matches exactly one of a specified set of characters
©NIIT Linux Basics Lesson 1B / Slide 16 of 26 Introduction to Linux Demonstration-Creating File Hierarchy Problem Statement Deez Inc. call center maintains the call-related data in a file hierarchy structure. The file hierarchy needs to be changed. According to the new requirements, the data related to the incoming calls needs to be stored in a centralized directory, ALLCALLS. This directory will contain two subdirectories, T01 and T02, to store the data related to two teams. Each of these two team directories will contain three subdirectories corresponding to the three team members in each team. Team members store their files only in their respective directories.
©NIIT Linux Basics Lesson 1B / Slide 17 of 26 Introduction to Linux Demonstration-Creating File Hierarchy (Contd.) Problem Statement (Contd.) The following figure depicts the hierarchy of the files: Angela has been assigned the task of creating the preceding file hierarchy structure. The file hierarchy needs to be created under the home directory on Angela’ s computer.
©NIIT Linux Basics Lesson 1B / Slide 18 of 26 Introduction to Linux Demonstration-Creating File Hierarchy (Contd.) Solution To create the file hierarchy structure, Angela needs to perform the following tasks: 1.Identify the levels in the file hierarchy. 2.Identify the order in which the directories need to be created. 3.Identify the commands used for creating the file hierarchy. 4.Verify the directory structure after creating it.
©NIIT Linux Basics Lesson 1B / Slide 19 of 26 Introduction to Linux File Access Permissions File access permissions refer to the permissions associated with a file and directory with respect to the file owner, group owner, and other users. The following table lists various file access permissions: Access Type Denoted by Action Permitted on a File Action Permitted on a Directory Read r Allows you to display, copy, and compile the file Allows you to list the contents of the directory Write w Allows you to edit, rename or move the file to another location Allows you to create new files and sub-directories within this directory Execute x Allows you to execute the file provided the file also has the read permission Allows you to move to that directory using the cd command
©NIIT Linux Basics Lesson 1B / Slide 20 of 26 Introduction to Linux File Access Permissions (Contd.) The access permissions associated with a file or directory can be changed using the chmod command. $ chmod mode file/s The file access permissions for a file can be changed using: Symbolic mode: Uses the following symbols to represent the permission and the type of users: ‘u’ is used for owner of file ‘g’ is used for group users ‘o’ is used for other users ‘a’ is used for all users Absolute mode: Uses a series of digits to represent the actual permissions. For example, digits 4, 2, and 1 represent the read, write and execute permissions, respectively.
©NIIT Linux Basics Lesson 1B / Slide 21 of 26 Introduction to Linux Demonstration-Assigning File Access Permissions Problem Statement Steve is working as a team leader with the Allmart account of Deez Telecommunications Inc. He has created a file, Pricelist, in his home directory. The file, Pricelist, is a highly confidential file. There is always a risk of an unauthorized access to the file because various other people use Steve’s computer across the shifts. Though Steve has his login password secured, he wants to be sure regarding the confidentiality of the file. Steve does not want anybody other than himself to have an access to the file. Help Steve by suggesting him an appropriate solution.
©NIIT Linux Basics Lesson 1B / Slide 22 of 26 Introduction to Linux Demonstration-Assigning File Access Permissions (Contd.) Solution To provide an appropriate solution for restricting unauthorized access to the file, pricelist, Steve needs to perform the following steps: 1.Identify the security measure that should be used in the given situation. 2.Identify the type of user for whom the permission needs to be changed. 3.Identify the type of permission that needs to be changed. 4.Identify and implement the command to be used in the situation. 5.Verify the file access permission of the file.
©NIIT Linux Basics Lesson 1B / Slide 23 of 26 Introduction to Linux Summary In this lesson, you learned: Linux uses a hierarchical file system to enable rapid access to files. A file name in Linux: Can be up to 256 characters long Can contain special characters, except for ‘/’ Can contain both upper-case and lower-case letters Is case-sensitive Should not have a blank or a tab A file has to be referred to by its path name, which can be either of the following: Full/Absolute path name Relative path name
©NIIT Linux Basics Lesson 1B / Slide 24 of 26 Introduction to Linux Summary (Contd.) Every user has a home directory, which is used to maintain files and directories. There are different type of files in Linux, such as: Ordinary files Directory files Special files The types of users for files are: File owner Group owner Other users
©NIIT Linux Basics Lesson 1B / Slide 25 of 26 Introduction to Linux Summary (Contd.) Some of the commonly used directory commands are: pwd : Prints the current working directory cd : Changes the current working directory mkdir : Creates a new directory rmdir : Removes an empty directory ls : Displays the contents of a directory Some common file-handling commands are: cat : Displays the content of files cp : Makes copies of files rm : Removes a file or directory mv : Moves or renames files and directories more, less : Displays the content of a file, one screen-full at a time
©NIIT Linux Basics Lesson 1B / Slide 26 of 26 Introduction to Linux Summary (Contd.) Wildcard characters are used to work on a set of files rather than a single file. The following are the wildcard characters available in Linux: * : Matches none, one, or more characters ? : Matches exactly one character  : Matches exactly one of a specified set of characters File access permissions refer to the permissions for a file with respect to users. File access permissions can be changed using the chmod command. The chmod command specifies the file permissions in the following ways: Symbolic: The permission and the user type are specified as symbols. Absolute: The permission is specified as a number.
Chapter Two Exploring the UNIX File System and File Security.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
©NIIT Collaborate Lesson 1C / Slide 1 of 23 Collaborate Knowledge Byte In this section, you will learn to: Use the cal command Determine the file types.
Chapter 2: Exploring the UNIX/Linux File Systems and File Security Guide To UNIX Using Linux Third Edition.
Exploring the UNIX File System and File Security Understanding Files and Directories.
Chapter Two Exploring the UNIX/Linux File Systems and File Security Guide To UNIX Using Linux Fourth Edition Chapter 2 Unix (31 slides)1 CTEC 110.
Linux+ Guide to Linux Certification, Third Edition Chapter 4 Linux Filesystem Management.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Week 4 Linux File System Management. Objectives Find files and directories on the filesystem Understand and create linked files Explain the function.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Linux+ Guide to Linux Certification, Second Edition Chapter 5 Linux Filesystem Management.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
©NIIT Pipes and Filters Lesson 2B / Slide 1 of 28 Introduction to Linux Pre-Assessment Questions 1.Consider the following statements: Statement A: A text.
The file structure and related utilities CS240 Computer Science II.
Unix Basics Chapter 4. The Filesystem Partitions / - The root partition: essential system binaries & configuration files /bin contains shells, ls, mkdir,
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5 Files and directories in UNIX Various types of files File attributes Notion of pathname Commands.
Linux Commands C151 Multi-User Operating Systems.
SUSE Linux Enterprise Desktop Administration Chapter 7 Manage Directories and Files.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Learning basic Unix command IT 325 operating system.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control The Unix file system is set up like a tree branching out from the root.
5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. –Most users will have.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
The Unix File System R Bigelow. The UNIX File System The file system refers to the way in which UNIX implements files and directories. The UNIX file system.
Introduction to Programming Using C An Introduction to Operating Systems.
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
Introduction to Unix (CA263) File System By Tariq Ibn Aziz.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Chapter Four: UNIX/Linux File Processing Guide To UNIX Using Linux Third Edition.
1 Introduction to Unix. 2 What is UNIX? UNIX is an Operating System (OS). An operating system is a control program that helps the user communicate.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.
Linux Linux File System. Hierarchy Standard File Hierarchy Standard (FHS) Defines a standard set of directories for use by all Linux and UNIX systems.
Chapter Four UNIX/Linux File Processing Guide To UNIX Using Linux Fourth Edition Chapter 4 (27 Slides)1 CTEC 110.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Chapter 4 The File Structure. Contents u The Hierarchical File Structure u Directory and Ordinary Files u Directories u Access Permissions u Links.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Managing Files. Module 5 Managing Files ♦ Introduction “On a Linux system, everything is a file; if something is not a file, it is a process.” ♦ Topics.
© 2017 SlidePlayer.com Inc. All rights reserved.