Saturday, June 9, 2012

ET0023 OPERATING SYSTEMS [rha030-workbook-student-5.0-2]

Questions
Workbook 1
Workbook 1 / Chapter 1. Logging In

1.Which of the following best describes why Linux is referred to as a multiuser operating system?
( ) a. Multiple users can use the same machine simultaneously, using multiple network connections and dumb
terminals.
( ) b. Multiple users can use the same machine, but only one at a time.
( ) c. Many people contributed to the development of the Linux operating system.
( ) d. Linux is not referred to as a multiuser operating system.

2. Which of the following is not an advantage of using virtual consoles instead of a graphical interface?
( ) a. Virtual consoles often respond more quickly than graphical environments.
( ) b. Virtual consoles operate at the kernel level, and so can be used to debug the system when higher level
components are mis-configured.
( ) c. Virtual consoles are very intuitive, and help is available in an obvious manner.
( ) d. Graphical environments add a lot of complexity to a system, and can make them harder to maintain.

3. From the first virtual console, which key sequence(s) will take you to the second virtual console?
( ) a. CTRL-ALT-2
( ) b. CTRL-ALT-F2
( ) c. CTRL-2 (using the numeric keypad)
( ) d. None of the above.

4. From the X graphical environment, which key sequence(s) will take you to the second virtual console?
( ) a. ALT-F2
( ) b. CTRL-ALT-F2
( ) c. Both a and b.
( ) d. None of the above.

5. If a user has logged into the X graphical environment, but desires to use a terminal command line interface, how
might she go about obtaining a terminal?

( ) a. Using the CTRL-ALT-F3 key-sequence to switch to a virtual console.
( ) b. Clicking the terminal icon that appears in the bottom panel.
( ) c. Right click in the desktop, and choose "Open Terminal" from the pop-up menu.
( ) d. Both a and c

6. What does the who command report?
( ) a. The users who have logged onto the machine since midnight.
( ) b. The users who are currently logged onto the machine, and where they logged on from.
( ) c. The users who are currently logged onto the machine, and how much time they have remaining before
their session expires.
( ) d. The command is used to lookup users from an Internet database of all users.

7. Which of the following is NOT required in order to open a remote shell using ssh?
( ) a. The remote machine must be running the ssh service.
( ) b. You must know the username and password of an account on the machine.
( ) c. The local machine must be a Linux machine.
( ) d. You must know the hostname or IP address of the remote machine.

Workbook 1 / Chapter 2. The Kernel, Programs, and Processes
1.Which of the following is not considered an operating system?
( ) a. Red Hat Enterprise Linux
( ) b. Windows XP
( ) c. Microsoft Office
( ) d. Mac OS X

2. Which of the following is not true for the Linux operating system?
( ) a. Multiple processes appear to be running at the same time.
( ) b. Only one instance of any given program may be running as a process.
( ) c. Programs are stored as files in the filesystem.
( ) d. Only one instance of the kernel may be running at any given time.

3. Which of the following is a true statement?
( ) a. Only the root user may run processes from a shell.
( ) b. The shell is a process that is commonly used to execute other processes.
( ) c. The shell is the kernel component that interacts directly with hardware.
( ) d. Only one instance of a shell may be running as a process.

4. Which of the following is the default shell for Red Hat Enterprise Linux?
( ) a. /bin/bash
( ) b. /bin/tcsh
( ) c. /bin/zsh
( ) d. /bin/sh

5. Which of the following is the command for listing processes?
( ) a. ps
( ) b. lsps
( ) c. lps
( ) d. ls

Workbook 1 / Chapter 3. Examining the Filesystem


1. Assuming the shell’s current working directory is /home/elvis, which of the following would refer to the file
/home/elvis/Mail/sent?
( ) a. Mail/sent
( ) b. /Mail/sent
( ) c. sent
( ) d. /sent

2. As the user elvis, whose shell’s current working directory is /home/elvis, which of the following would refer to
the file received, which is in the directory Mail, which is in the home directory?
( ) a. /home/elvis/Mail/received
( ) b. Mail/received
( ) c. received
( ) d. both A and B.

3. Which of the following commands would list the files in the /usr/lib directory?
( ) a. cat /usr/lib
( ) b. lsdir /usr/lib
( ) c. /usr/lib list

( ) d. ls /usr/lib


4. Which of the following commands would successfully redirect the output of the cal to the file lsout.txt?
( ) a. lsout.txt > cal
( ) b. cal ==> lsout.txt
( ) c. cal > lsout.txt
( ) d. cal } lsout.txt

5. For the user elvis, with /home/elvis for a home directory, which of the following commands would succeed on
a default Red Hat Enterprise Linux installation?
( ) a. ls /etc > /etc/lsetc.txt
( ) b. /etc/lsetc.txt < ls /etc
( ) c. ls /etc > /home/elvis/lsetc.txt
( ) d. /home/elvis/lsetc.txt < ls /etc


Workbook 1 / Chapter 4. Running Commands 


1. Which of the following would be a legitimate invocation of the touch command?
( ) a. touch -k /etc/services
( ) b. touch -ac /etc/services
( ) c. touch -nocreate /etc/services
( ) d. touch -t

2. Which of the following would be a legitimate invocation of the touch command?
( ) a. touch -frm /etc/services
( ) b. touch --cm /etc/services
( ) c. touch --no-create -a /etc/services
( ) d. touch


3. Which best describes why madonna got the "file arguments missing" error message when running touch -r
/etc/services?
( ) a. The -r command line switch requires an argument, which madonna didn’t supply.
( ) b. The file /etc/services does not exist.
( ) c. The touch command could not be found on the system.
( ) d. -r is not a supported command line switch.

4. Which best describes why madonna got the "command not found" error message when running tooch
/etc/services?
( ) a. The file /etc/services does not exist.
( ) b. madonna misspelled the command name, and no command named tooch could be found.
( ) c. The touch command requires a mandatory -a command line switch.
( ) d. madonna does not have the right permissions to execute the command.

5. Which best describes why madonna got the "invalid option" error message when running touch -k /etc/services?
( ) a. The file /etc/services does not exist.
( ) b. madonna misspelled the command name, and no command named touch could be found.
( ) c. The touch command requires a mandatory -a command line switch.
( ) d. The touch command doesn’t support the -k command line switch.

6. When madonna ran the command touch -r /etc/services /tmp/foo, what best describes the role of the word
/etc/services?
( ) a. The word serves as an argument to the touch command.
( ) b. The word serves as an argument to the -r command line switch.
( ) c. The word serves as the name of the command to run.
( ) d. The word is misplaced, and caused the command to exit in failure.

7.When a user runs the command who from the command line, which of the following best describes what happens?
( ) a. The shell asks the kernel to execute the contents of the file /usr/bin/who as a separate process,
displaying the process’s output on the terminal.
( ) b. The shell makes the who system call, prompting the Linux kernel for the output directly.
( ) c. The shell exits, and is replaced by the who process.When the who process terminates, it replaces itself
with a new shell process.


8. When long command line switches were introduced, which best describes why they were preceded with a double
hyphen (such as --size) instead of a single hyphen (such as -size)?
( ) a. The creators of long command line switches liked to type a lot.
( ) b. The word -size could be interpreted as a shortcut for the -s -i -z -e short command line switches, instead of
a single long command line switch.
( ) c. A single hyphen already implied a mandatory command line switch argument.
( ) d. The creators of long command line switches liked to make things complicated.

Workbook 1 / Chapter 5. Managing Terminals


1.Which of the following commands can restore a terminal to sane behavior?
( ) a. sanetty
( ) b. reload
( ) c. start-unicode
( ) d. reset
( ) e. sane

2. Which of the following control sequences can be used to suspend a command?
( ) a. CTRL-C
( ) b. CTRL-D
( ) c. CTRL-Q
( ) d. CTRL-U
( ) e. CTRL-Z

3. If you walk up to a terminal that seems completely non-responsive, which control sequence might restore activity?
( ) a. CTRL-C
( ) b. CTRL-D
( ) c. CTRL-Q
( ) d. CTRL-U
( ) e. CTRL-Z

4. If you suspect that you have mistyped while entering a password, which control sequence would allow you to start
over?
( ) a. CTRL-C
( ) b. CTRL-D
( ) c. CTRL-Q
( ) d. CTRL-U
( ) e. CTRL-Z


5. If you want to cancel a command that is generating too much output, which control sequence would be most
helpful?
( ) a. CTRL-C
( ) b. CTRL-D
( ) c. CTRL-L
( ) d. CTRL-S
( ) e. CTRL-U

6. If you want to freeze the terminal output, so that you can resume it later, which control sequence would be most
helpful?
( ) a. CTRL-C
( ) b. CTRL-D
( ) c. CTRL-L
( ) d. CTRL-S
( ) e. CTRL-U

7. Which control sequence causes bash to clear the screen?
( ) a. CTRL-C
( ) b. CTRL-D
( ) c. CTRL-L
( ) d. CTRL-S
( ) e. CTRL-U

Use the output from the who command to answer the following questions.
[prince@station prince]$ who
blondie tty2 Apr 21 22:07
elvis tty1 Apr 21 22:07
elvis tty3 Apr 21 22:07
root tty6 Apr 21 22:07
prince :0 Apr 21 21:50
prince pts/0 Apr 21 21:53 (:0.0)
prince pts/1 Apr 21 21:54 (:0.0)
prince pts/2 Apr 21 21:55 (:0.0)
madonna pts/3 Apr 21 22:08 (:0.0)


8. How has the user blondie logged onto the Enterprise Linux machine?
( ) a. Using the Login Manager in the X graphical environment.
( ) b. A virtual console.
( ) c. A serial line connected terminal.
( ) d. A ssh network connection
( ) e. The login method cannot be determined with the information provided.

9. How has the user prince logged onto the Enterprise Linux machine?
( ) a. Using the Login Manager in the X graphical environment.
( ) b. A virtual console.
( ) c. A serial line connected terminal.
( ) d. A ssh network connection
( ) e. The login method cannot be determined with the information provided.

10. Which user logged on as the administrative user root?
( ) a. blondie
( ) b. elvis
( ) c. madonna
( ) d. prince
( ) e. It cannot be determined with the information provided.

Workbook 1 / Chapter 6. Getting Help


1.Which of the following is not a way to obtain help for the ls command?
( ) a. help ls
( ) b. ls --help
( ) c. man ls
( ) d. pinfo ls
( ) e. All are legitimate ways of obtaining help.

2. When viewing a man page, which key causes the pager to quit?
( ) a. Z
( ) b. TAB
( ) c. q
( ) d. RETURN
( ) e. SPACE

3. Which chapter of the man pages would contain documentation on the /etc/group configuration file?
( ) a. 1
( ) b. 4
( ) c. 5
( ) d. 7
( ) e. 8


4. Which chapter of the man pages would contain documentation on the groups command?
( ) a. 1
( ) b. 4
( ) c. 5
( ) d. 7
( ) e. 8

5. Which chapter of the man pages would contain documentation on filename suffixes, and the type of file that they
imply?
( ) a. 1
( ) b. 4
( ) c. 5
( ) d. 7
( ) e. 8

6. In the table listing man page chapters, chapter 6 was omitted.What does this chapter contain information on?
( ) a. Unix history
( ) b. hardware devices
( ) c. networking protocols
( ) d. graphical applications
( ) e. games

7. Which of the following commands would generate a keyword search of the man pages for the word sleep?
( ) a. mankey sleep
( ) b. man --key sleep
( ) c. man -key sleep
( ) d. keyword sleep
( ) e. None of the above commands would work.


8. Informally structured documentation is found where in a Red Hat Enterprise Linux distribution?
( ) a. Red Hat Enterprise Linux only includes formally structured documentation.
( ) b. /usr/share/doc
( ) c. /usr/doc
( ) d. /usr/doc/share
( ) e. /tmp/doc/

9. Which of the following interfaces to the info pages allows someone to navigate links with mouse clicks?
( ) a. The pinfo command.
( ) b. The info command.
( ) c. The yelp application.
( ) d. A and C

10. What type of help can be viewed with the GNOME Help Browser, yelp?
( ) a. documentation for GNOME graphical applications
( ) b. man pages
( ) c. info pages
( ) d. A and C
( ) e. All of the above

Workbook 2
Workbook 2 / Chapter 1. Filesystem Navigation


All these questions assume you are logged in as user student on a typical classroom system.
1. Which of the following is a relative directory reference?
( ) a. /home/student
( ) b. /etc
( ) c. ..
( ) d. ~

2. Which of the following could have been displayed by pwd?
( ) a. home/student
( ) b. /etc
( ) c. ..
( ) d. ~

3. Following the command cd ~, which is the most likely result from pwd?
( ) a. /home/student
( ) b. /etc
( ) c. ..
( ) d. ~
Your screen shows the following:
[student@station html]$ cd ../bin
[student@station bin]$ pwd
/home/student/bin
[student@station bin]$ cd -



4. What would be the output of the command pwd?
( ) a. /home/student
( ) b. /home/student/html
( ) c. /home/html
( ) d. -

5. Which of the following pairs of commands always produce the same effect?
( ) a. cd .. and cd -
( ) b. cd / and cd root
( ) c. cwd and pwd
( ) d. cd ~ and cd


Workbook 2 / Chapter 2. Important Directories


1.Which of these is most likely not someone’s home directory?
( ) a. /home/student
( ) b. /root
( ) c. /
( ) d. None of these - all are likely to be home directories

2. The file named.conf is a system configuration file. This file belongs in
( ) a. /tmp
( ) b. /etc
( ) c. /bin
( ) d. /sbin

3. The file e2fsck is a privileged command that must always be available to the system. This file would be found in
( ) a. /tmp
( ) b. /etc
( ) c. /bin
( ) d. /sbin

4. The /root directory is noteworthy because
( ) a. It is the root of the Linux filesystem
( ) b. It is the superuser’s home directory
( ) c. It can always be abbreviated as ~
( ) d. Its contents cannot be read by any user.

5. Which of the following commands could not be used to create a file in /tmp?
( ) a. touch /newfile
( ) b. touch /tmp/newfile
( ) c. touch ../newfile
( ) d. touch ../tmp/newfile



6. T/F: /bin and /usr/bin contain the same files.
( ) a. True
( ) b. False

7. T/F: Only the root user can read files in etc.
( ) a. True
( ) b. False

8. T/F: Files for a website might often be found in /var.
( ) a. True
( ) b. False

9. T/F: Configuration files that customize each user’s account are placed in /etc/users.d.
( ) a. True
( ) b. False

10. T/F: X uses /tmp.
( ) a. True
( ) b. False


Workbook 2 / Chapter 3. Managing Files


1. The command to make a duplicate of a file is
( ) a. dupe
( ) b. rep
( ) c. copy
( ) d. cp

2. To copy file1.txt to file2.txt, you could use
( ) a. cp file1.txt > file2.txt
( ) b. cp file1.txt file2.txt
( ) c. dupe file1.txt file2.txt
( ) d. mv file1.txt file2.txt

3. The successful command mv f1 f2 f3 f4
( ) a. moves four items from the current directory
( ) b. moves four items to the current directory
( ) c. moves four items to the default directory
( ) d. moves three items from the current directory

4. To erase the file file1 from the current directory, you could use
( ) a. rm file1
( ) b. erase file1
( ) c. del file1
( ) d. cut file1

5. The command cp file.a file.b will clobber file.b if
( ) a. file.a is an ordinary file
( ) b. file.a is non-empty
( ) c. file.b is an ordinary file
( ) d. file.b is a directory


6. If /home/student is a directory, then the command rm /home/student will
( ) a. remove all files in the directory
( ) b. delete the directory from the filesystem
( ) c. delete the student user account
( ) d. produce an error message

7. The command echo file.1 file.2 will
( ) a. copy file.1 to file.2
( ) b. display the contents of file.1 and file.2 on STDOUT
( ) c. produce an error message because there is no redirection symbol
( ) d. display "file.1 file.2" on STDOUT

8. The command ls > file.1 will
( ) a. produce an error message because > is an unprotected shell meta-character
( ) b. append the normal output of ls to file.1
( ) c. replace file.1 if it already exists
( ) d. fail if file.1 already exists

9. Assuming both exist, the command mv item.1 item.2 will move an entire subdirectory tree
( ) a. only if both item.1 and item.2 are existing subdirectories
( ) b. only if special command options are used
( ) c. only if item.2 is empty
( ) d. only if item.1 is empty

10. The command cp item.1 item.2 will copy an entire subdirectory tree
( ) a. only if both item.1 and item.2 are existing subdirectories
( ) b. only if special command options are used
( ) c. only if item.2 is empty
( ) d. only if item.1 is empty

Workbook 2 / Chapter 4. Managing Directories

1.Which command will list the contents of the directory report recursively?
( ) a. lsdir report

( ) b. ls --recur report
( ) c. ls -r report
( ) d. ls -R report
( ) e. ls report \r



The user hogan is executing the following command.
[hogan@station hogan]$ cp rep1.txt rep2.txt rep3.txt reps



2. For the command to succeed, which of the following statements must be true?
( ) a. The file rep1.txt must be a text file.
( ) b. The file rep1.txt must be an existing directory.
( ) c. The file reps must be an existing directory.
( ) d. The files rep1.txt, rep2.txt, and rep3.txt must be existing directories.
( ) e. The command cannot succeed, because the -r command line switch must be specified when using multiple arguments.

3. Which command creates a new, empty directory?
( ) a. md
( ) b. nd
( ) c. mkdir
( ) d. newdir
( ) e. touch -d
In his home directory, hogan has a directory called website, which contains various files and subdirectories, and a
currently empty directory called archive, as illustrated in the following graph.
.
|-- archive/
‘-- website/
|-- forms/
|-- html/
| |-- index.html
| |-- page1.html
| |-- page2.html
| ‘-- page3.html
‘-- media/
|-- photos/
| |-- picture1.png
| ‘-- picture2.png
‘-- songs/
|-- song1.midi
‘-- song2.midi


For the following questions, assume that the current working directory is hogan’s home directory, /home/hogan.

4. What would be the effect of the following command? cp -r website archive
( ) a. The directory archive would be clobbered, and replaced with a copy of the website directory.
( ) b. The directory archive would contain a new subdirectory called website.
( ) c. An error, because the cp command does not work on directories.
( ) d. An error, because -r is not a legitimate switch for the cp command.
( ) e. None of the above

5. What would be the effect of the following command? cp website archive/website.bak
( ) a. The directory archive would contain a new subdirectory called website.bak.
( ) b. An error, because the directory archive/website.bak does not exist.
( ) c. An error, because the -r command line switch must be included when copying directories.
( ) d. An error, because the correct command to use is cpdir.
( ) e. None of the above

6. What would be the effect of the following command? mv -r website archive
( ) a. The directory archive would be clobbered, and replaced with the website directory.
( ) b. The directory archive would contain a new subdirectory called website.
( ) c. An error, because the mv command does not work on directories.
( ) d. An error, because the mv command does not recognize the -r command line switch.
( ) e. None of the above

7. Which of the following commands would move the website/media directory and its subdirectories to
archive/media
( ) a. mv -r website/media archive/media
( ) b. mv website/media archive/media
( ) c. mv website/media archive
( ) d. Both B and C
( ) e. All of the above


8. Which of the following commands would remove the website/media directory and its subdirectories?
( ) a. rmdir website/media
( ) b. rm website/media
( ) c. rm -r website/media
( ) d. Both A and C
( ) e. All of the above

9. Which of the following commands would copy the website directory, and all of its subdirectories except
website/media/photos?
( ) a. cp -x photos website archive
( ) b. cp -d2 website archive
( ) c. cp -x photos website archive/website
( ) d. cp -d2 website archive/website
( ) e. None of the above

10. Why would someone be tempted to use rmdir instead of rm -r?
( ) a. To ensure that overlooked files in the directory are not unintentionally erased.
( ) b. Because the rmdir command works recursively, without needing to specify a command line switch.
( ) c. The rmdir command creates an automatic backup of everything it removes.
( ) d. Both B and C
rha030-5.0-






Workbook 2 / Chapter 5. File Names and File Globbing


Note: The following questions all end in an appropriate question mark, which should not be considered part of
any specified commands.
Use the output from the following command to answer the next 5 questions.

[elvis@station files]$ ls
ebbs eras lakes lit loop olden rank renew robe run whirr
echo erect lamed lives lorry one rapid reply robed wagon whorl
elope ergo lash loads lost ounce rasp retry rock wares wile
enact erupt lead loath loves oust rays rho rocky ways windy
end evens leaks lobby lows ovary razor rigid rooms weak witty
enjoy evoke leaps locus loyal overt read rigs roses weep wools

entry ewes learn logic lucks racks reaps rime rouge wench wound
envoy lace leech login oaks radon recta riots rove west wrens
epic laced lick loin obese raged recur risks row wet writ

1. Which of the following files would be included in the output of the command ls r*s ?
[ ] a. eras
[ ] b. raged
[ ] c. rigs
[ ] d. retry
[ ] e. racks
[ ] f. wrens



2. Which of the following files would be included in the output of the command ls r?? ?
[ ] a. eras
[ ] b. row
[ ] c. riots
[ ] d. rho
[ ] e. wet
[ ] f. run

3. Which of the following files would be included in the output of the command ls [aeiou]??? ?
[ ] a. ebbs
[ ] b. lead
[ ] c. oft
[ ] d. whip
[ ] e. oaks
[ ] f. oust

4. Which of the following files would be included in the output of the command ls *[^aeiou] ?
[ ] a. ebbs
[ ] b. rove
[ ] c. one
[ ] d. rasp
[ ] e. ways
[ ] f. era


5. Which of the following files would be included in the output of the command ls [aeiou]?e* ?
[ ] a. ebbs
[ ] b. rove
[ ] c. one
[ ] d. rasp
[ ] e. ways
[ ] f. rouge







Use the following recursive listing of the /etc/X11/gdm directory to answer the following questions.
[student@station student]$ ls -R /etc/X11/gdm/
/etc/X11/gdm/:
factory-gdm.conf gnomerc locale.alias PreSession XKeepsCrashing
gdm.conf Init PostSession Sessions
/etc/X11/gdm/Init:
Default
/etc/X11/gdm/PostSession:
Default
/etc/X11/gdm/PreSession:
Default
/etc/X11/gdm/Sessions:
default Default Failsafe GNOME KDE



6. Which of the following files would be included in the output of the command ls /etc/X11/gdm/S*/*a* ?
[ ] a. /etc/X11/gdm/Init/Default
[ ] b. /etc/X11/gdm/locale.alias
[ ] c. /etc/X11/gdm/factory-gdm.conf
[ ] d. /etc/X11/gdm/Sessions/Default
[ ] e. /etc/X11/gdm/Sessions/Failsafe
[ ] f. /etc/X11/gdm/Sessions/default


7. Which of the following files would be included in the output of the command ls /etc/X11/gdm/*/*[Ef] ?
[ ] a. /etc/X11/gdm/gdm.conf
[ ] b. /etc/X11/gdm/factory-gdm.conf
[ ] c. /etc/X11/gdm/Init/Default
[ ] d. /etc/X11/gdm/Sessions/GNOME
[ ] e. /etc/X11/gdm/Sessions/KDE
[ ] f. /etc/X11/gdm/Sessions/Failsafe

8. Which of the following files could be included in the output of the command ls /etc/*.?? ?
[ ] a. /etc/issue.net
[ ] b. /etc/mail.rc
[ ] c. /etc/php.ini
[ ] d. /etc/huh.??
[ ] e. /etc/xpdfrc.ja
[ ] f. /etc/gss-1.0

9. Which of the following files could be included in the output of the command ls /etc/[akp]??[0-9]* ?
[ ] a. /etc/krb5.conf
[ ] b. /etc/as5-0
[ ] c. /etc/pbm2ppa.conf
[ ] d. /etc/a2ps.cfg
[ ] e. /etc/php.ini
[ ] f. /etc/krc8

10. Which of the following files would be included in the output of the command ls
/etc/[aeiou][^aeiou]??[aeiou]* ?
[ ] a. /etc/adjtime
[ ] b. /etc/issue
[ ] c. /etc/aeplog.conf
[ ] d. /etc/at.deny
[ ] e. /etc/at.allow
[ ] f. /etc/auto.tab



Workbook 2 / Chapter 6. Examining Files


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.