Part 3 - Exploring the system Flashcards

Explored files, directories and their contents. Learned about how open this system is.

1
Q

What does the command file do?

A

Determine file type

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

What does the command less do?

A

View file contents

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

What is the difference between ls, ls /usr and ls ~ /usr ?

A

ls lists the files and directories in your current directory, ls /usr list the the content in usr directory ( you don’t have to be in it) and ls ~ /usr sends two arguments to ls one to show your user directory and your home directory at the same time!

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

What is the structure of a command?

A

command -options arguments

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

What does the command ls -lt do?

A

Ls lists contents and l option means long format and t option sorts the result by the file’s modification time.

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

What happens if you add ls -lt —reverse?

A

–reverse is a long option that reverses the order of the sort.

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

Explain this long format view ‘-rw-r–r– 1 root root 4378932 2024-04-03 11:05 Text.odt’

A

‘-rw-r–r–’ access right to the file. 1st character indicates type of file. Leading dash means reg file and d means directory. ‘1’ file number of hard links. ‘root’ the username of the file’s owner. ‘root’ the name of the group which owns the file. ‘4378932’ size of file in bytes. ‘2024-04-04 11:05’ date and time of last modification ‘ Text.odt’ name of the file.

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

What is a common idea in any Unix based operating system?

A

’ everything is file’

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

What is ASCII text?

A

American Standard Code for Information Interchange. Text is a simple one to one mapping of characters to numbers. 50 characters of text translates to 50 bytes of data.

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

Why would we want to examine text files?

A

Because many of the files that contain system settings ( config files) are stored in this format.

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

In less how do you scroll back a page?

A

Page up or b

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

In less how do you scroll forward 1 page?

A

Page Down or space

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

How do you move to the end of a text file?

A

G

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

How do you move to the beginning of a text file?

A

1G or g

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

What does / mean?

A

root directory

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

What is in /bin?

A

Binaries and they must be present for the system to boot and run.

17
Q

What is in /boot?

A

Linux kernel, initial RAM disk image (for drivers needed at boot time and the boot loader.

18
Q

what is /boot/vmlinuz?

A

the linux kernel

19
Q

What is /boot/grub/grub or menu.1st ?

A

file used to configure boot loader.

20
Q

What is in /dev?

A

Device nodes, where kernel maintains a list of all the devices it understands.

21
Q

What is in /etc?

A

system wide config files and a collection of shell scripts.

22
Q

What is in /etc/crontab, /etc/fstab and /etc/passwd?

A
  1. defines when the automated job will run 2. a table of storage devices 3. a list of the user accounts.
23
Q

What is /lib?

A

Contains shared library files used by core system programs.

24
Q

What is /lost+found

A

It is used in case of partial recovery from a file system corruption.

25
Q

What is /media?

A

contains the mount points for removable media such as USB

26
Q

What is /opt?

A

To install ‘optional’ software

27
Q

What is /proc?

A

Very special, a virtual file system maintained by the Linux Kernel. The files are peepholes into the kernel itself.

28
Q

What is /root?

A

The home dir for the root account ( need special permissions to enter)

29
Q

What is /sbin?

A

directory contains “system” binaries

30
Q

What is /tmp?

A

is intended for storage of temporary transient files created by various programs.

31
Q

What is /usr?

A

The largest directory tree on a Linux system. It contains all the programs and support files used by regular users.

32
Q

What are in /usr/bin, /usr/lib, /usr/local and /usr/sbin ?

A
  1. executable programs installed by your linux distro
  2. the shared libraries for the programs in usr/bin
  3. Programs that are not included in the distro but are intended for system wide use ( empty in fresh installs of distro)
  4. system admin programs
33
Q

What is in usr/share and usr/share/doc?

A
  1. shared data used by programs in /usr/bin
  2. documentation files organized by package.
34
Q

What is in /var?

A

Where data that is likely to change is stored.

35
Q

What is in /var/log?

A

log files that record system activity.

36
Q

If first entry of the access rights to the file is ‘l’ (L) and there are two filenames what does that mean?

A

This is a special kind of file called a symbolic link.

37
Q

Explain the usefulness of the symbolic link foo -> Foo-2.6.0 and foo -> Foo-2.7.0

A

foo is a shared resource among a few programs and a symbolic link is created to the version Foo-2.6.0 but then an upgrade is created a Foo-2.7.0 and instead of having to go into every program that uses Foo-2.6.0 and changing it to 2.7.0 you can just change the symbolic foo to now point to 2.7.0. Both 2.6.0 and 2.7.0 still exist so if you need to go back to the previous you can just change the symbolic link.

38
Q
A