the unix file system. what are the three parts of every file on a unix filesystem? and where is each...

14
The Unix File System

Upload: bartholomew-waters

Post on 17-Dec-2015

216 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

The Unix File System

Page 2: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What are the three parts of every file on a Unix filesystem? And where is each stored?

• Filename - stored in directories• Inode - stored in an inode table• Data – stored in data blocks on the storage media

Page 3: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What Unix command allows us to view the contents of directories?

• ls

Page 4: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What is kept in a Unix directory in addition to the names of files? What command is used to see this information?

• Inode numbers• ls -i

Page 5: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

Give four useful options to the ls command.

• ls -F - distinguishes directories from ordinary files

• ls -l - long listing, includes inode info.

• ls -a - shows hidden files as well

• ls -d - shows inode info. of a directory

Page 6: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What information about a file is kept in the inode that you can view in a long listing (ls –l)?

• Type of file (directory, ordinary, etc.)• File Permissions• Link count• Owner of the file• Group (gid) of the file• Size of the file• Modification date of the file (and other dates)• Pointers to where the data of the file is located

Page 7: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What Unix command prints out your current working directory? What is the name of that directory when you log in?

• pwd

• Your home directory

Page 8: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What Unix command can change your current working directory? What does this command do if you give it no arguments?

• cd

• With no arguments, the cd command makes your home directory your current working directory.

Page 9: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What two files are in every Unix directory, and why don’t they normally show up with the ls command?

• . and .. (dot - the current directory and dot-dot - the parent directory)

• they are hidden files

Page 10: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

Give an example of an absolute pathname and a relative pathname.

• Absolute pathname: /home/CIS90/guest/letter

• Relative to:Home directory: letterThe root directory:

home/CIS90/guest/letter

Page 11: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What option to the ls command lets you see a long listing of a directory file?

• ls -ld

Page 12: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

Unix filenames do not normally tell you whether a file is a program, directory, text, data, etc. What Unix command can you use to find a file’s type?

• file <filename>…

Page 13: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What are the three special characters used by the shell to collectively access groups of files? What are the pattern matching characteristics of each?

1. * - matches any number of characters, including none

2. ? - matches one and only one character

3. [] - matches any one of the characters contained within the brackets

Page 14: The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -

What are two reasons you may want to use these filename expansion characters?

• To access groups of files with common extensions or prefixes

• To save typing long file or directory pathnames; you need type only the characters that uniquely specify that file, followed by the *