Linux Shell and Directory Structure Flashcards

1
Q

In the terminal which one is a superuser notation and regular user:

1) “$”
2) “#”

A

“#” = Superuser
$ = User

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

Explain each level of file permissions (see example below)
- rwx r-x –x

A

Type: File

rwx : read,write,and execute for the owner

r-x : read and execute for group

–x: execute for the user/everyone else

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

Explain each level of file permissions (see example below)
d rw- r– r-x

A

Type: Directory

rw- : read,write for the owner

r– : read for group

r-x: read and execute for the user/everyone else

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

what does the “file” command do?

A

Provides file type with description

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

What is the /boot directory for?

A

Stores Linux kernel and boot loader files
- Kernel file is vmlinuz

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

What is the /etc directory for?

A

Contains configuration files for a system. All files in /etc should be text files

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

What are the following /etc subdirectories used for?

/etc/passwd
/etc/fstab
/etc/hosts
/etc/init.d

A

/etc/passwd - contains user accounts and essential user information

/etc/fstab - table of devices that get mounted when system boots

/etc/hosts - lists network host names and ip addresses

/etc/init.d - contains scripts that start various system services

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

What is the /bin and /usr/bin directory for?

A

/bin - essential programs that the system requires to operate

/usr/bin - contains applications for the system’s users

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

What is the /sbin and /usr/sbin directory for?

A

they both contain programs for system administration, mostly for use by the superuser (files apart of official distribution)

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

What is the /usr directory for?

A

Support user applications

“/usr/share/man” = where “man” pages are kept

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

What is the /usr/local directory for?

A

Software that is not part of the official distribution

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

What is the /var directory for?

A

contains files that change as the system is running

‘/var/log’ - where logs are traditionally stored

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

What is the /tmp directory for?

A

Where programs can write their temporary files to

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

What is the /dev directory for?

A

Where devices are available to the system. Does not contain files in the usual way

All devices that the kernel understands are represented here

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

What is the /proc directory for?

A

entirely virtual - provides insights into the kernel itself

“cat /proc/cpuinfo/”

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

What is the /media directory for?

A

Used for mount points

Use the “mount” command to see what devices and mount points are used.