GNUUnix Flashcards
Which of the following commands can be used to create a USB storage media from a disk image?A. gdisk B. dd C. cc D. fdisk E. mount
dd
In Bash, inserting 1>&2 after a command redirects? A. standard error to standard input. B. standard input to standard error. C. standard output to standard error. D. standard error to standard output. E. standard output to standard input.
standard output to standard error.
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
cut -d: -f1,7 /etc/passwd
In a nested directory structure, which find command line option would be used to restrict the command to searching down a particular number of subdirectories? A. -dirmax B. -maxdepth C. -maxlevels D. -n
-maxdepth
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 kills the process with the PID 123 but allows the process to "clean up" before exiting? A. kill -PIPE 123 B. kill -KILL 123 C. kill -STOP 123 D. kill -TERM 123
kill -TERM 123
Which signal is missing from the following command that is commonly used to instruct a daemon
to reinitialize itself, including reading configuration files?
killall -s _______ daemon
HUP, SIGHUP, 1
What is the maximum niceness value that a regular user can assign to a process with the nice command when executing a new process? A. 9 B. 19 C. 49 D. 99
19
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)
p (lowercase)
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
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
Which of the following commands will send output from the program myapp to both standard output (stdout) and the file file1.log? A. cat < myapp | cat > file1.log B. myapp 0>&1 | cat > file1.log C. myapp | cat > file1.log D. myapp | tee file1.log E. tee myapp file1.log
myapp | tee file1.log
What is the purpose of the Bash built-in export command?
A.
It allows disks to be mounted remotely.
B.
It runs a command as a process in a subshell.
C.
It makes the command history available to subshells.
D.
It sets up environment variables for applications.
E.
It shares NFS partitions for use by other systems on the network.
It sets up environment variables for applications.
What is the output of the following command?
echo “Hello World” | tr -d aieou
A. Hello World B. eoo C. Hll Wrld D. eoo Hll Wrld
Hll Wrld
Which of the following characters can be combined with a separator string in order to read from
the current input source until the separator string, which is on a separate line and without any
trailing spaces, is reached?
A.
«
B.
<
Which of the following commands will NOT update the modify timestamp on the file /tmp/myfile.txt?
A. file /tmp/myfile.txt B. echo "Hello" >/tmp/myfile.txt C. sed -ie "s/1/2/" /tmp/myfile.txt D. echo -n "Hello" >>/tmp/myfile.txt E. touch /tmp/myfile.txt
file /tmp/myfile.txt
What is the default nice level when a process is started using the nice command? A. -10 B. 10 C. 20 D. 0
10
What is the default action of the split command on an input file?
A.
It will break the file into new files of 1,024 byte pieces each.
B.
It will break the file into new files of 1,000 line pieces each.
C.
It will break the file into new files of 1,024 kilobyte pieces each.
D.
It will break the file into new files that are no more than 5% of the size of the original file.
It will break the file into new files of 1,000 line pieces each.
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.
i (insert) inserts text before the current cursor position whereas a (append) inserts text after the
cursor.
Which command displays a list of all background tasks running in the current shell? (Specify
ONLY the command without any path or parameters.)
jobs