Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 240 Introduction to UNIX Instructor: Sue Sampson.

Similar presentations


Presentation on theme: "CIS 240 Introduction to UNIX Instructor: Sue Sampson."— Presentation transcript:

1 CIS 240 Introduction to UNIX Instructor: Sue Sampson

2 CIS240 – UNIX File Systems Points to remember… A file is a sequence of bytes All resources, including hardware, are treated as files Five types of files: simple/ordinary, directory, symbolic (soft) link, special (device), and named pipe (FIFO).

3 CIS240 – UNIX File Systems Simple/ordinary files: used to store info and data Directories: contain other files and directories Symbolic (soft) link files: think alias Special files: used to access hardware devices, two types; character – for keyboard, block – for disks Named pipes (FIFO): aka IPCs, sockets, allows two processes to communicate

4 CIS240 – UNIX File Systems Windows File System:

5 CIS240 – UNIX File Systems UNIX File System: Page 149 – directory descriptions

6 Basic File Operations: List Add Change Copy Move Delete Change Ownership/Group Change Permissions CIS240 – UNIX File Systems

7 Files are added and changed by: The operating system Applications software (editors, word processors, spreadsheets, databases, etc) Transfer in from a network or external storage device (loading software packages or files transfer)

8 CIS240 – UNIX File Systems Files are deleted by: rm command We can delete a single file or group of files with this command (wildcards) Directories are deleted by: rmdir (directory must be empty)

9 CIS240 – UNIX File Systems Getting to your home directory: cd cd ~ cd $HOME – case sensitive… All three commands will get you back to your home directory.

10 CIS240 – UNIX File Systems File Attributes: $ ls –l $ -rw-r----- 1 sue softdev 2654 Jul 27 9:33 report_data Permission flags UserNumber of links Number of bytes Last modified File Name Group

11 CIS240 – UNIX File Systems - r w x r w x r w x Permissions for others Permissions for group Permissions for user(owner) Device apportionment indicator – see page 159 Categories:

12 CIS240 – UNIX File Systems File Permission Flags: The owner: person who owns the file The group: people in the same group as the file owner Others: all possible users Device apportionment: - for file, d for directory

13 CIS240 – UNIX File Systems Directory Permissions: Read: Allowed to read the directory to show information about files in the directory, but only if the filenames are known. Write: Allowed to create and delete files in the directory Execute: Allowed to search the directory (discover what files are present.), execute file (if it’s an executable)

14 CIS240 – UNIX File Systems Mode can be expressed as octal number or as a series of switches  User (u), group (g), others (o), all (a)  Read (r), write(w), execute(x)  A plus adds a permission  A minus removes a permission  Multiple requests are allowed, separated by commas Samples:  chmod 777 test.txt  chmod g+r,g-w,g-x test.txt Changing Permissions: $ chmod

15 CIS240 – UNIX File Systems Changing Permissions: - switches $ chmod Example: $ ls -l -r—r----- 1 sue softdev 4536 Jul 21 9:33 report $ chmod u+w report $ ls –l -rw-r----- 1 sue softdev 4536 Jul 21 9:33 report

16 CIS240 – UNIX File Systems Changing Permissions: -- numeric Example: $ ls -l -r—r----- 1 sue softdev 4536 Jul 21 9:33 report $ chmod 640 report $ ls –l -rw-r----- 1 sue softdev 4536 Jul 21 9:33 report - r w x r w x r w x 421421421


Download ppt "CIS 240 Introduction to UNIX Instructor: Sue Sampson."

Similar presentations


Ads by Google