Week 2 - File system, utilities Flashcards
A file system contains (3 things)
Ordinary files
Directories
Special files
What is a file exactly?
inode + data blocks
What is an inode?
Used to reference a file in a file system.
Contains all meta data about a file except for the data itself: File type, file size, permissions, timestamps, link count, etc.
What is a directory?
Holds references to other files (directory entries)
Directory entry maps filename -> inode number
Contains 2 files . and ..
What are the 7 different types of Unix files?
- plain files
d directories
b block special file
c character special file
l symbolic link
s socket
p named pipe
Each file is owned by a user (T or F)
T
Each file is associated wit h a group (T or F)
T
chmod u+rw <filename>
chmod a+x <filename>
chmod g+w <filename></filename></filename></filename>
Explain each
user - read + write
all - execute
group - write
What does ‘setfacl’ do?
Modifies a file’s access control list.
ex:
-m: Modify an existing ACL.
-x: Remove an ACL.
-b: Remove all ACL entries (reset).
Give a user (alice) read and write permissions on a file (file.txt)
setfacl -m u:alice:rw file.txt
What is an Access Control List (ACL)?
Rules for which users can access specific dirs/files
What is the umask?
Sets the initial permissions of a file.
chmod 755 == umask 022 (inverse)
Difference between symbolic and hard links?
A symbolic link simply stores a relative path to the file.
A hard link points to the inode of the original, effectively creating an alias without making a copy of the data.
(File not removed until all hard links deleted)
Tokens are separated by ______
Any whitespace char: space tab newline
What is the X Window System?
Ca fun an X app on one machine and have it displayed on another machine running X.
Based on client server