Pre-Assessment Questions

Slides:



Advertisements
Similar presentations
A Guide to Unix Using Linux Fourth Edition
Advertisements

CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
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.
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Linux+ Guide to Linux Certification, Second Edition
Linux Linux File System.
The UNIX File System.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Learning basic Unix command IT 325 operating system.
©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.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
Guide To UNIX Using Linux Fourth Edition
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
The file structure and related utilities CS240 Computer Science II.
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”
Manage Directories and Files in Linux
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
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.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Unix Basics Chapter 4.
Linux+ Guide to Linux Certification, Second Edition
©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.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
Chapter Two Exploring the UNIX File System and File Security.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
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.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Chapter Two Exploring the UNIX File System and File Security.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Chapter 4 The File Structure. Contents u The Hierarchical File Structure u Directory and Ordinary Files u Directories u Access Permissions u Links.
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:
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
Introduction to Programming Using C An Introduction to Operating Systems.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Linux Commands C151 Multi-User Operating Systems.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
SUSE Linux Enterprise Desktop Administration Chapter 7 Manage Directories and Files.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
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.
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.
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.
Learning basic Unix command It 325 operating system.
CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
Linux Filesystem Management
Agenda The Linux File System (chapter 4 in text)
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Lecture 2 Working with Files and Directories
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
Exploring the UNIX File System and File Security
Introduction Paul Flynn
Module 6 Working with Files and Directories
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

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

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

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

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

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

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

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

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

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

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

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

Directory Commands in Linux The commonly used directory commands in Linux are: pwd: Displays the full path name of the current directory: [steve@linuxpc1 steve]$ pwd cd: Changes the current directory to the directory specified: [steve@linuxpc1 steve]$ cd /usr/bin mkdir: Creates directories under a specified or current directory: [steve@linuxpc1 steve]$ mkdir prog-files rmdir: Removes the specified directory: [steve@linuxpc1 steve]$ rmdir prog-files ls: Displays the names of the files and subdirectories in a directory: [steve@linuxpc1 steve]$ ls /home/steve Introduction to Linux

Common File Commands The commonly used file commands in Linux are: cat: Displays the content of the specified file. [steve@linuxpc1 steve]$ cat data1 cp: Duplicates the content of the source file into a target file. The syntax of the cp command is: [steve@linuxpc1 steve]$ cp [options] <source file/s> <destination directory/file> rm: Deletes files. The syntax of the rm command is: [steve@linuxpc1 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@linuxpc1 steve]$ mv [option] source destination Introduction to Linux

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

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

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

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

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

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

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

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

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

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

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

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