Q1. CORRECT TEXT - (Topic 3)
Which Bash environment variable defines in which file the user history is stored when exiting a Bash process? (Specify ONLY the variable name.)
Answer: HISTFILE
Q2. - (Topic 3)
What is the difference between the i and a commands of the vi editor?
A. i (interactive) requires the user to explicitly switch between vi modes whereas a (automatic) switches modes automatically.
B. i (insert) inserts text before the current cursor position whereas a (append) inserts text after the cursor.
C. i (independent rows) starts every new line at the first character whereas a (aligned rows) keeps the indentation of the previous line.
D. i (interrupt) temporarily suspends editing of a file to the background whereas a (abort) terminates editing.
Answer: B
Q3. - (Topic 3)
Which of the following command sets the Bash variable named TEST with the content FOO?
A. set TEST="FOO"
B. TEST = "FOO"
C. var TEST="FOO"
D. TEST="FOO"
Answer: D
Q4. - (Topic 3)
When starting a program with the nice command without any additional parameters, which nice level is set for the resulting process?
A. -10
B. 0
C. 10
D. 20
Answer: C
Q5. - (Topic 2)
Which RPM command will output the name of the package which supplied the file /etc/exports?
A. rpm -F /etc/exports
B. rpm -qf /etc/exports
C. rpm -Kl /etc/exports
D. rpm -qp /etc/exports
E. rpm -qi /etc/exports
Answer: B
Q6. - (Topic 3)
What is the effect of the egrep command when the -v option is used?
A. It enables color to highlight matching parts.
B. It only outputs non-matching lines.
C. It shows the command's version information.
D. It changes the output order showing the last matching line first.
Answer: B
Q7. - (Topic 3)
Immediately after deleting 3 lines of text in vi and moving the cursor to a different line, which single character command will insert the deleted content below the current line?
A. i (lowercase)
B. P (uppercase)
C. p (lowercase)
D. U (uppercase)
E. u (lowercase)
Answer: C
Q8. - (Topic 2)
Which of the following commands lists the dependencies of a given dpkg package?
A. apt-cache depends-on package
B. apt-cache dependencies package
C. apt-cache depends package
D. apt-cache requires package
Answer: C
Q9. CORRECT TEXT - (Topic 3)
Which command displays a list of all background tasks running in the current shell? (Specify ONLY the command without any path or parameters.)
Answer: jobs
Q10. - (Topic 4)
Which of the following commands creates an ext3 filesystem on /dev/sdb1? (Choose TWO correct answers.)
A. /sbin/mke2fs -j /dev/sdb1
B. /sbin/mkfs -t ext3 /dev/sdb1
C. /sbin/mkfs -c ext3 /dev/sdb1
D. /sbin/mke3fs -j /dev/sdb1
Answer: A,B
Q11. - (Topic 4)
Which of the following commands changes the number of days before the ext3 filesystem on /dev/sda1 has to run through a full filesystem check while booting?
A. tune2fs -d 200 /dev/sda1
B. tune2fs -c 200 /dev/sda1
C. tune2fs -i 200 /dev/sda1
D. tune2fs -n 200 /dev/sda1
E. tune2fs --days 200 /dev/sda1
Answer: C
Q12. - (Topic 3)
When given the following command line.
echo "foo bar" | tee bar | cat
Which of the following output is created?
A. cat
B. foo bar
C. tee bar
D. bar
E. foo
Answer: B
Q13. - (Topic 4)
Which type of filesystem is created by mkfs when it is executed with the block device name only and without any additional parameters?
A. ext2
B. ext3
C. ext4
D. XFS
E. VFAT
Answer: A
Q14. - (Topic 3)
What command will generate a list of user names from /etc/passwd along with their login shell?
A. column -s : 1,7 /etc/passwd
B. chop -c 1,7 /etc/passwd
C. colrm 1,7 /etc/passwd
D. cut -d: -f1,7 /etc/passwd
Answer: D
Q15. - (Topic 2)
Which of the following commands lists all currently installed packages when using RPM package management?
A. yum --query --all
B. yum --list --installed
C. rpm --query --all
D. rpm --list –installed
Answer: C
Q16. - (Topic 3)
Which of the following shell redirections will write standard output and standard error output to a file named filename?
A. 2>&1 >filename
B. >filename 2>&1
C. 1>&2>filename
D. >>filename
E. 1&2>filename
Answer: B
Q17. - (Topic 1)
Which of the following options for the kernel's command line changes the systemd boot target to rescue.target instead of the default target?
A. systemd.target=rescue.target
B. systemd.runlevel=rescue.target
C. systemd.service=rescue.target
D. systemd.default=rescue.target
E. systemd.unit=rescue.target
Answer: E
Q18. - (Topic 4)
Which of the following pieces of information of an existing file is changed when a hard link pointing to that file is created?
A. File size
B. Modify timestamp
C. Link count
D. Inode number
E. Permissions
Answer: C