Understanding Linux file Types Flashcards

1
Q

what does POSIX stand for?

A

POSIX = Portable Operation System Interface

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

How many file types does the POSIX standard define?

A

7

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

Which are the file types?

A

Regular

Directory

Sym link

FIFO

Block

Character

Socket

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

What is the command to see a file’s type?

A

file

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

what defines a file’s type?

A

what defines a file’s type is its magic number in the header and the #file command interprets this #

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

How can you identify a regular file?

A

Regular files: denoted by a hypen - in ls -l

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

What do regular files have?

A

they have a file name pointing to an inode which in turn points to a data block

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

Can a regular file contain another file or directory?

A

No

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

How can you identify a directory?

A

they are denoted by a d - in ls -l

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

What do directories have within?

A

They have entries to other directories (sub dir) and other regular files

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

Can hard links be a directory?

A

No

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

Hard links are limited to the same what?

A

Hard links must be in the same inode table, meaning the same File system

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

What do hard links have?

A

they have a file name pointing to an inode which in turn points to a data block, same as a regular file

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

How can you identify a sym link?

A

in the output of ls -l, you will see a lowecase L

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

For who can you create sym links?

A

Sym links can be created for files and directories as well

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

Can sym links cross FS?

A

yes

17
Q

what does a sym link do?

A

they are a full path reference to another file o directory

18
Q

what perms do sym links have?

A

they have 777 perms

19
Q

what does FIFO mean?

A

FIFO pipe (first in - first out pipe)

20
Q

How can you identify a FIFO?

A

denoted by a p in the o/p of ls -l

21
Q

what command creates a FIFO file?

A

mkfifo

22
Q

What is an unamed pipe?

A

Unnamed pipes: such as ls -l | wc -l

they are a one-way communication between commands and you can pipe as many as you want/needed

23
Q

What is a named pipe?

A

so you can take a command and send its output to a pipe file, and then use that pipe file contents as stdin of another command
command to create a file that will work as a pipe is #mkfifo

24
Q

What is a socket for?

A

they are for bi-directional communication between local or remote systems

25
Q

What are the 2 types of block files?

A

block types (b) and character types (c)

26
Q

What are block types?

A

both types:

they represent hardware, but not network devices
they connect the kernel drives and the device

27
Q

What are block devices?

A

Block devices:

denoted by a b in the o/p of ls -l
usually disk devices which send data in blocks

28
Q

What are character devices?

A

Character devices:

sound cards, serial/parallel ports
they send data in characters