Quiz digest Flashcards

1
Q

what does the host command do?

A

Lookup A, AAAA, and MX records of a domain,
or reverse DNS lookup

very similar to nslookup and dig

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

what does the dmesg command do?

A

displays the contents of the kernel ring buffer

It may not display older info because it is overwritten by newer info and stored in RAM

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

What command generated the following output?

21:04:15 up 14 days, 7:43, 3 users, load average : 0.89, 1.00 0.99

A

uptime

(or w)

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

What command generated the following output?

Filesystem Size Used Avail Use% Mounted on
/dev/mapper 25G 20G 3.6G 85% /
/vg_ssd-root

A

df -h

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

What command generated the following output?

1.8M /tmp

A

du -h

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

What command generated the following output?

total used free shared buff/cache available
Mem : 9113232 3546 54522 463621 99385113

A

free

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

What directory must be mounted with read and write access if it resides on its own dedicated filesystem?

A

/var

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

What is the return value of a shell script after successful execution?

A

0

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

What is the return value of a shell script after a failed execution?

A

any number 1 - 255

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

What is Dovecot

A

Mail server like Postfix

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

What is the PATH environment variable?

How do you display it?

A

ordered list of paths that Linux will search for executables when running a command

echo $PATH

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

perform a case-insensitive search with line numbers

A

grep -in

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

What command extracts the contents of a tar archive?

A

tar -x

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

What command creates an archive file work.tar from the contents of the directory ./work/?

A

tar cf work.tar ./work/

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

Where does Linux stores most of its log files in the directory tree?

A

/var/log

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

Where are configuration files stored?

A

/etc

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

What command would you use to create a symbolic link in Linux?

A

To create a soft link from the shell, you should use
ln -s <original_file> <link_created>
The soft link is essentially a pointer to the original file, and when the original file is deleted, the soft link does not point to anything, so “no such file or directory” is reported.</link_created></original_file>

18
Q

What does the command ‘last’ show?

A

recent user login times, tty line used, current status

19
Q

How do you view a running processes’ PID?

A

ps

20
Q

Default zip compression level?

A

6

21
Q

What is a sticky bit?

A

flag that ensures only the the owner can rename or delete a file.

——–t

22
Q

Identify each of these:

–s–s–t

A

SUID
SGID
Sticky Bit

23
Q

4
u+s

A

SUID

24
Q

2
g+s

A

SGID

25
Q

SUID + SGID

A

6
ug

26
Q

Tells Linux to run the program with the permissions of whoever owns the
file rather than the user who runs the program

A

SUID

–s——

27
Q

Sets the group of the running program to the group of the file

A

SGID

—–s—

28
Q

view free disk space?

A

du

29
Q

How do you view the kernel version?

A

uname -r

30
Q

what command views kernel ring buffer?

A

dmesg

31
Q

/proc/ contains what?

A

one directory per process

32
Q

where is GID - group name mapping stored?

A

/etc/group

33
Q

what is a symbolic link?
How do you create one?

A

they point to the path of another file. If you delete the target file the link points to the link will still exist, but it “stops working”, as it now points to “nothing”.

ln -s targetfile linkname

34
Q

what is a hard link?
How do you create one?

A

An additional entry in the file system pointing to the same place (inode) on the disk. Can be moved freely within the same filesystem but doesn’t work across them.

ln targetfile linkname

35
Q

which directory stores most of the documentation and example configurations (basically manual pages).

A

/usr/share/doc/

36
Q

command that can delete non empty directory

A

rm -r

37
Q

Which two tar options control compression?

A

-z
-j

38
Q

How do you create a tar archive?

A

tar cf targetfile /destination/

The c option instructs tar to create a new archive file and the f option is the name of the file to create.

39
Q

How do you zip files?

A

zip desiredfilename *.txt

40
Q

How do you extract an archrive?

A

tar -x

41
Q

How do you decompress a file or tarball?

A

unzip filename

for tarball:
tar -xz

42
Q

chown syntax?

A

chown username:groupname filename