1. By default on which file system the Linux dump command operates?
a. EXT2
b. JFS
c. XFS
d. ReiserFS
e. EXT3
Answer: a and e
Explanation: It might be considered a bug that the latest version of dump can only handle ext2/3 filesystems.
2. Which single command changes the subnet of a network interface?
a. route
b. default
c. netstat
d. ifconfig
e. none of the above
Answer: d. ifconfig allow you to change all parameters of an interface. Here is an example:
ifconfig wlan0 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
3. Which file system should not be backed up / restored?
a. ext2
b. xfs
c. ext3
d. /home
e. swap
Answer: e. Swap stores temporary information which can be easily recreated.
4. Which directory tree should not be backed up / restored?
a. /tmp
b. /etc
c. /proc
d. /usr
e. /home
Answer: a and c. /tmp stores only temporary files with short life cycle. /proc is dynamically generated by the kernel.
5. What command verifies for syntax errors in /etc/hosts.allow and /etc/hosts.deny?
a. tcpdchk
b. udpdchk
c. netstat
d. iptables
e. setup
Answer: a. tcpdchk checks only for syntax errors the files in question.
6. How can you enable onscreen numbers in a vi (vim) session?
a. set nu
b. se nu
c. set num
d. set +o num
e. set +o nu
Answer: a. and b. It is quite tricky to recognize that set can be used as se for shorter. Unnaturally nu and num are not the same
7. How can you set a user's password invalid after 60 days?
a. passwd -x 60 user
b. passwd -e 60 user
c. chage -M 60 user
d. change -m 60 user
e. usermod -f 60 user
Answers: a. and c. You have to study in details the manuals for passwd, chage and usermod. It is imortant to note the differences between these cases:
- a password expires, the user can log in and change it
- a password has expired and the user cannot log in to change it.
8. What is the binary conversion of the IP address 10.0.15.124?
a. 00101001.00000000.00000001.00011101
b. 00001010.00000000.00001111.01111100
c. 00011010.00000000.00001111.01111100
d. 00011010.00000000.00001101.01111100
e. 00001010.00000000.00001111.01101100
Answer: b. Converting decimals to binary should be quite straightforward. Check this link for help:
http://www.wikihow.com/Convert-from-Decimal-to-Binary
9. The file .rhosts when put in a user's home directory specifies:
a. which remote hosts can log in with the user's username without password
b. which remote hosts are known to the ssh server
c. which remote hosts can be accessed with user's username without password
d. which remote hosts are allowed to connect with the user's username
e. none of the above
Answer: a. The answer is pretty self explanatory. You should know that this option is rarely used nowadays because of security concerns.
10. Which file examines ldconfig for paths to libraries?
a. /etc/ld.so.conf
b. /etc/modules.conf
c. /etc/conf.modules
d. /etc/ld.so.cache
e. none of the above
Answer: a. ldconfig examines /etc/ld.so.conf for all paths to libraries. After that /etc/ld.so.cache is generated.
11. Which command will create / update /etc/shadow to md5 compatible?
a. passconv
b. pwconv
c. mdconv
d. passwd
e. sha1sum
Answer: b. It is important to know that pwconv either creates (if there is no /etc/shadow) or updates the file /etc/shadow with the passwords from /etc/passwd (seconf field on each row). Once the password is converted to /etc/shadow, it is deleted from /etc/passwd (substituted with x).
12. Which command (with exact options) was run to produce the following output?
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 4366 0.0 0.0 1696 516 tty4 Ss+ 13:19 0:00 /sbin/getty 384
root 4367 0.0 0.0 1692 516 tty5 Ss+ 13:19 0:00 /sbin/getty 384
root 4370 0.0 0.0 1692 512 tty2 Ss+ 13:19 0:00 /sbin/getty 384
root 4371 0.0 0.0 1692 516 tty3 Ss+ 13:19 0:00 /sbin/getty 384
root 4372 0.0 0.0 1696 520 tty1 Ss+ 13:19 0:00 /sbin/getty 384
root 4373 0.0 0.0 1692 516 tty6 Ss+ 13:19 0:00 /sbin/getty 384
root 4965 1.5 3.2 38080 32880 tty7 Ss+ 13:19 4:49 /usr/bin/X :0 -
terry 6678 3.5 0.3 5748 3096 pts/0 Ss 18:30 0:00 bash
terry 6708 0.0 0.0 2620 1000 pts/0 R+ 18:30 0:00 the_command
Answer: ps au. Make sure you are fully familiar with ps and all of its useful options - from au to auxwf.
13. You wish to copy files overwriting old files. The cp command is aliased with -i (prompt before overwriting). What is the best choice:
a. use cp -f to force to overwriting
b. use the full path to cp /bin/cp to escape the alias
c. use cp -y - to answer yes to all promots
d. use mc
e. first remove the old files and then copy the new ones over
Answer: b . The easiest solution is to use the full path to cp. There is no way to escape the prompts when -i is aliased
14. Which command will show the last kernel messages?
a. dmesg
b. tail /var/log/messages
c. lsmod
d. modinfo
e. none of the above
Answer: a and b. The difference is that dmesg shows only kernel messages, while /var/log/messages may log other things too.
15. When you run 'runlevel', the output is 'N 2'. What does it mean?
a. The current runlevel is 2, there is no previous runlevel
b. The current runlevel is N, the previous runlevel is 2.
c. The current runlevel is N 2.
d. The above output is not possible.
e. There is no such command runlevel.
Answer: a. runlevel specifies first the previous runlevel and then the current runlevel. N means there has been no previous runlevel.
16. Your IP is 192.168.0.15 with netmask 255.255.255.192. Which of the following IPs are not part from your network:
a. 192.168.0.44
b. 192.168.0.18
c. 192.168.0.99
d. 192.168.0.244
e. 192.168.0.2
Answer: c and d. By subnetting 255.255.255.192 defines separate networks with 64 hosts (64=256-192. Of course the first IP is used for the network address while the last is for broadcasts). For self-checking purposes, I recommend using sipcalc, a linux console based IP calculator. Here is how the above can be checked with it:
terry@a1:~$ sipcalc -a 192.168.0.15 255.255.255.192
17. How are you going to flush all pring jobs from all queues?
a. lprm -a all
b. lprm -all
c. lprm *
d. lpadmin --remove-all
e. none of the above
Answer: a. Lprm is not very intuitive so make sure to study its manual in details
18. How are you going to enable traffic forwarding between two NICs in the kernel configuration?
a. echo 'ip_forward=yes' /etc/network/interfaces
b. echo 'ip_forward=yes' >> /etc/modules.conf
c. echo yes > /proc/sys/net/ipv4/ip_forward
d. echo 1 > /proc/sys/net/ipv4/ip_forward
e. It is not possible to change it on the fly. You have to recompile the kernel with this option checked.
Answer: d. The file /proc/sys/net/ipv4/ip_forward is generated by the kernel at boot time but changes are re-read. Make sure 1 is specified there in order traffic forwarding to work.
19. According to RFC 1918, which of the following networks are private?
a. 10.0.0.0 netmask 255.0.0.0
b. 192.168.0.0 netmask 255.255.0.0
c. 191.168.0.0 netmask 255.255.0.0
d. 172.16.0.0 netmask 255.240.0.0
e. 11.0.0.0 netmask 255.0.0.0
Answers: a, b and c. Make sure to note that 172.16.0.0 has a subnet mask which defines as private all IPs from 172.16.0.0 to 172.31.255.255.
20. Which protocol ping and traceroute depend on?
a. TCP
b. UDP
c. ICMP
d. TCP/IP
e. IPX
Answer: ping and traceroute use ICMP - Internet Control Message Protocol defined in RFC 792


