Topic 3, GNU and Unix Commands
In compliance with the FHS, in which of the directories are man pages found?
A.
/usr/share/man
B.
/opt/man
C.
/usr/doc/
D.
/var/pkg/man
E.
/var/man
/usr/share/man
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 modesautomatically.
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.
i (insert) inserts text before the current cursor position whereas a (append) inserts text
after the cursor.
A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remove that directory?
A.
rmdir '~/\dir'
B.
rmdir "~/\dir"
C.
rmdir ~/'dir'
D.
rmdir ~/\dir
E.
rmdir ~/\\dir
rmdir ~/\\dir
What does the + symbol mean in the following grep regular expression:
grep '^d[aei]\+d$' /usr/share/dict/words
A.
Match the preceding character set ([aei]) one or more times.
B.
Match the preceding character set ([aei]) zero or more times.
C.
Match the preceding character set ([aei]) zero or one times.
D.
Match a literal + symbol.
Match the preceding character set ([aei]) one or more times.
What happens after issuing the command vi without any additional parameters?
A.
vi starts and loads the last file used andmoves the cursor to the position where vi was
when it last exited.
B.
vi starts and requires the user to explicitly either create a new or load an existing file.
C.
vi exits with an error message as it cannot be invoked without a file name to operate on.
D.
vi starts in command mode and opens a new empty file.
E.
vi starts and opens a new file which is filled with the content of the vi buffer if the buffer
contains text.
vi starts in command mode and opens a new empty file.
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
Which of the following files, located in the user home directory, is used to store the Bash
history?
A.
bash_history
B.
bash_histfile
C.
history
D.
bashrc_history
E.
history_bash
bash_history
Explanation:
QUESTIONNO: 26
Which Bash environment variable defines in which file the user history is stored when
exiting a Bash process? (Specify ONLY the variable name.)
Which of the following commands will print the last 10 lines of a text file to the standard output?
A.
cat -n 10 filename
B.
dump -n 10 filename
C.
head -n 10 filename
D.
tail -n 10 filename
tail -n 10 filename
Which of the following statements is correct regarding the command foo 1> bar?
A.
The stdout from the command foo is appended to the file bar.
B.
The stdout from the command foo overwrites the file bar.
C.
The command foo receives its stdin from the file bar.
D.
The command foo receives its stdin from the stdout of the command bar.
E.
The stderr from the command foo is saved to the file bar.
The stdout from the command foo overwrites the file bar.
Which of the following commands displays the contents of a gzip compressed tar archive?
A.
gzip archive.tgz | tar xvf -
B.
tar ztf archive.tgz
C.
gzip -d archive.tgz | tar tvf -
D.
tar cf archive.tgz
tar ztf archive.tgz
Page 7 out of 25 Pages |
Previous |