Quiz digest Flashcards
what does the host command do?
Lookup A, AAAA, and MX records of a domain,
or reverse DNS lookup
very similar to nslookup and dig
what does the dmesg command do?
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
What command generated the following output?
21:04:15 up 14 days, 7:43, 3 users, load average : 0.89, 1.00 0.99
uptime
(or w)
What command generated the following output?
Filesystem Size Used Avail Use% Mounted on
/dev/mapper 25G 20G 3.6G 85% /
/vg_ssd-root
df -h
What command generated the following output?
1.8M /tmp
du -h
What command generated the following output?
total used free shared buff/cache available
Mem : 9113232 3546 54522 463621 99385113
free
What directory must be mounted with read and write access if it resides on its own dedicated filesystem?
/var
What is the return value of a shell script after successful execution?
0
What is the return value of a shell script after a failed execution?
any number 1 - 255
What is Dovecot
Mail server like Postfix
What is the PATH environment variable?
How do you display it?
ordered list of paths that Linux will search for executables when running a command
echo $PATH
perform a case-insensitive search with line numbers
grep -in
What command extracts the contents of a tar archive?
tar -x
What command creates an archive file work.tar from the contents of the directory ./work/?
tar cf work.tar ./work/
Where does Linux stores most of its log files in the directory tree?
/var/log
Where are configuration files stored?
/etc
What command would you use to create a symbolic link in Linux?
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>
What does the command ‘last’ show?
recent user login times, tty line used, current status
How do you view a running processes’ PID?
ps
Default zip compression level?
6
What is a sticky bit?
flag that ensures only the the owner can rename or delete a file.
——–t
Identify each of these:
–s–s–t
SUID
SGID
Sticky Bit
4
u+s
SUID
2
g+s
SGID
SUID + SGID
6
ug
Tells Linux to run the program with the permissions of whoever owns the
file rather than the user who runs the program
SUID
–s——
Sets the group of the running program to the group of the file
SGID
—–s—
view free disk space?
du
How do you view the kernel version?
uname -r
what command views kernel ring buffer?
dmesg
/proc/ contains what?
one directory per process
where is GID - group name mapping stored?
/etc/group
what is a symbolic link?
How do you create one?
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
what is a hard link?
How do you create one?
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
which directory stores most of the documentation and example configurations (basically manual pages).
/usr/share/doc/
command that can delete non empty directory
rm -r
Which two tar options control compression?
-z
-j
How do you create a tar archive?
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.
How do you zip files?
zip desiredfilename *.txt
How do you extract an archrive?
tar -x
How do you decompress a file or tarball?
unzip filename
for tarball:
tar -xz
chown syntax?
chown username:groupname filename