Week 2 - File system, utilities Flashcards

1
Q

A file system contains (3 things)

A

Ordinary files
Directories
Special files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a file exactly?

A

inode + data blocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an inode?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a directory?

A

Holds references to other files (directory entries)

Directory entry maps filename -> inode number

Contains 2 files . and ..

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the 7 different types of Unix files?

A
  • plain files
    d directories
    b block special file
    c character special file
    l symbolic link
    s socket
    p named pipe
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Each file is owned by a user (T or F)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Each file is associated wit h a group (T or F)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

chmod u+rw <filename>
chmod a+x <filename>
chmod g+w <filename></filename></filename></filename>

Explain each

A

user - read + write
all - execute
group - write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does ‘setfacl’ do?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is an Access Control List (ACL)?

A

Rules for which users can access specific dirs/files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the umask?

A

Sets the initial permissions of a file.

chmod 755 == umask 022 (inverse)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Difference between symbolic and hard links?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Tokens are separated by ______

A

Any whitespace char: space tab newline

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the X Window System?

A

Ca fun an X app on one machine and have it displayed on another machine running X.

Based on client server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly