Use the file command to help answer the following 2 questions.
1. What type of file is /usr/bin/htmlview?
A. A compiled ELF Executable
B. An Awk script
C. A Bash (Bourne-Again) shell script
D. A Symbolic Link
E. A /usr/bin/perl script
2. What type of file is /dev/log?
A. A character special file
B. A block special file
C. A socket
D. A named pipe
E. A compiled ELF executable
3. Which of the following commands would act the same as cp a.txt b.txt, assuming the file b.txt does not exist?
A. cat -5 a.txt b.txt
B. cat a.txt b.txt
C. cat -A a.txt > b.txt
D. cat a.txt > b.txt
E. None of the above.
4. Which of the following key sequences can be used to quit the less pager?
A. q
B. x
C. CTRL-C
D. Both A and C
E. All of the above
5. While reading the file /etc/services, which of the following is an advantage of the less pager over the more pager?
A. less allows the user to browse output one page at a time, while more does not.
B. less recognizes familiar navigation keys, such as UpArrow and PgDown.
C. less allows users to page backwards through the file, while more only allows users to page forwards.
D. less allows the user to quit with a simple q, while more requires a CTRL-C
E. All of the above
6. Which of the following commands would display the first 5 lines of the file /etc/passwd?
A. head -5 /etc/passwd
B. head -n /etc/passwd
C. head –five /etc/passwd
D. head /etc/passwd > 5
E. head /5 /etc/passwd
7. Why would you expect trouble from the following command?
[bob@station bob]$ head /bin/ls
A. The user bob does not have permissions to read the file /bin/ls.
B. The head command must be called with the -n command line switch, to specify how many lines to show.
C. The file /bin/ls is too small for the head command
D. The file /bin/ls is a binary file, and the head command works primarily on text files.
E. None of the above.
8. How can a user stop the tail -f command?
A. There is no need to, as the command times out after 10 seconds.
B. By typing the q key.
C. With the CTRL-Q control sequence.
D. By switching virtual consoles.
E. None of the above.
Use the following output to help in answering the next two questions.
[alice@station alice]$ cat -An /etc/fstab
1 LABEL=/ / ext3 defaults 1 1$
2 LABEL=/boot /boot ext3 defaults 1 2$
3 none /dev/pts devpts gid=5,mode=620 0 0$
4 none /proc proc defaults 0 0$
5 none /dev/shm tmpfs defaults 0 0$
6 /dev/hda2 swap swap defaults 0 0$
9. Which of the following is NOT true?
A. The /etc/fstab file is 6 lines long.
B. The columns in the /etc/fstab are separated by tabs instead of spaces.
C. The /etc/fstab file is a text, instead of binary, file.
D. The commands head -8 /etc/fstab and tail -6 /etc/fstab would produce identical output.
E. None of the Above.
10. How would the output of the commands cat /etc/fstab /etc/fstab and head /etc/fstab /etc/fstab differ?
A. The first command would only list the contents of the /etc/fstab file once.
B. The first command would display tabs as visible characters.
C. The second command would only show the first 10 lines of the duplicated /etc/fstab file.
D. The second command would include banners identifying the filename in the output.
E. None of the above.