chapter 3 quiz
To display the contents of a text file called data, what command should be used? a)cat data b)ls data c)disp data d)ls -l data
a)cat data
Select the command below that can be used to provide a long listing for each file in a directory: a)ls -l b)ls -T c)ls -F d)ls -L
a)ls -l
What command can be issued to confirm what directory you are in at a command line prompt? a)pwd b)ld c)dir d)whereami
a)pwd
What command can be used to display the last five lines of a text file? a)tail -5 b)head -5 c)stop -5 d)end -5
a)tail -5
What metacharacter can be used to refer to the current user's home directory? a)˜ b)# c)@ d)&
a)˜
If enough unique letters of a directory name have been typed, what key can be pressed to activate the BASH shell's completion feature? a)Esc b)Tab c)Ctrl d)Alt
b)Tab
At the vi command mode prompt, what key combination below will force a quit from the vi editor without saving changes? a):exit b):q! c):! d):q
b):q!
Using wildcard metacharacters, how can one indicate a number is either 1, 2, 3, or 4? a)1-4 b)[1234] c)[1-4] d)[1,2,3,4]
c)[1-4]
In order to move from the /home/joe/test/data to the /home/joe directory, what command below should be issued? a)/home/joe b)cd .. c)cd ../.. d)cd ./..
c)cd ../..
In what mode does the vi editor open by default? a)insert mode b)insert mode c)command mode d)overview mode
c)command mode
To display a text file in reverse order, what command should be used? a)tee b)sed c)tac d)cat
c)tac
Which switch below can be added to the ls command to show a list of files and their type? a)-L b)-T c)-l d)-F
d)-F
In vi, using command mode, what series of key presses below will cause the line on which the cursor is on to be deleted? a)dd b)d c)X d)yw
d)yw