Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pre-Assessment Questions

Similar presentations


Presentation on theme: "Pre-Assessment Questions"— Presentation transcript:

1 Pre-Assessment Questions
Identify the service that Windows operating systems use to share files and printers. Samba CRON Scheduler Web Server Licensing Identify the default shell for most Linux systems. Tcsh A Z Bash Introduction to Linux

2 Pre-Assessment Questions
The output, Aug, is being displayed on the screen. Identify the command that has generated this output. date "+%a" date "+%h" date "+%y" date "+%r" Which columns display the date and time information of the currently logged on users when the who command is executed? 1, 2, and 3 2, 3, and 4 3, 4, and 5 1, 2, and 5 Introduction to Linux

3 Pre-Assessment Questions
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? Statement A is True but Statement B is False. Statement A is False but Statement B is True. Both, Statement A and Statement B, are True. Both, Statement A and Statement B, are False. Introduction to Linux

4 Solutions to Pre-Assessment Questions
a. Samba d. Bash b. date "+%h“ c. 3, 4, and 5 a. Statement A is True but Statement B is False Introduction to Linux Lesson 1B / Slide 4 of 26

5 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 Introduction to Linux

6 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 Introduction to Linux

7 The Linux File System (Contd.)
A sample Linux file hierarchy structure ©NIIT Introduction to Linux Working with the Shell Lesson 1B / Slide 7 of 26

8 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 Introduction to Linux

9 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 2004. Alternatively, Steve can specify the relative path, baseball/September 2004. Relative path is a more convenient way to specify path names. Introduction to Linux

10 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. Introduction to Linux

11 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. Introduction to Linux

12 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 Introduction to Linux

13 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] <source file/s> <destination directory/file> 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 Introduction to Linux

14 Common File Commands (Contd.)
more: Displays data one screen-full at a time. The syntax of the more command is: steve]$ more [options] <filename> 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] <filename> Introduction to Linux

15 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: Character Purpose  * 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 Introduction to Linux

16 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. Introduction to Linux

17 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. Introduction to Linux

18 Demonstration-Creating File Hierarchy (Contd.)
Solution To create the file hierarchy structure, Angela needs to perform the following tasks: Identify the levels in the file hierarchy. Identify the order in which the directories need to be created. Identify the commands used for creating the file hierarchy. Verify the directory structure after creating it. Introduction to Linux

19 Action Permitted on a File Action Permitted on a Directory
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 Introduction to Linux

20 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. Introduction to Linux

21 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. Introduction to Linux

22 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: Identify the security measure that should be used in the given situation. Identify the type of user for whom the permission needs to be changed. Identify the type of permission that needs to be changed. Identify and implement the command to be used in the situation. Verify the file access permission of the file. Introduction to Linux

23 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 Introduction to Linux

24 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 Introduction to Linux

25 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 Introduction to Linux

26 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. Introduction to Linux


Download ppt "Pre-Assessment Questions"

Similar presentations


Ads by Google