Chapter 1: UNIX Basics
Practice Questions



1.  

Which vi command quits without saving changes you've made to the file?



2.  

Which of the following commands will not report your login name?



3.  

What part of the command line sort -f -o sorted list is "sorted?"



4.  

Identify the command that will turn the shell variable MYDIR into an environment variable.



5.  

Identify the command line that stores output in a file named ">".



6.  

The value of an environment variable cannot contain a "$" sign.



7.  

In the command > file1 cat < file2, which file contains input and which file contains output?



8.  

Identify the command that displays a section of the UNIX reference manual.



9.  

Which numeric permission is being assigned with the command chmod u=rwx,g=rw,o=r basketball?



10.  

What is the output of the command ls -l $(whence vi)?



11.  

Which of the following pairs of file names is matched by the pattern [Bx][B-x]*1? (The question mark is not part of the pattern.)



12.  

Identify the command that will remove the variable MYDIR from the environment.



13.  

Choose the command which will remove a file named -file.



14.  

In vi command mode, which is the key sequence to move the cursor up (towards the beginning of the file) two lines, to the right by three characters, and then down one line?



15.  

When you use the command chmod +rw hockey, what permissions are you giving the file hockey?



16.  

You start vi with the command vi parsley sage rosemary thyme. Which file are you editing after the commands :n :e parsley :n?



17.  

Which of the following directories is a hidden directory?



18.  

Identify the command that will let you choose which occurrence of "Simon" you will change to "Garfunkel." looking at all of them in the file.



19.  

Given the files fat, fee, fie, foe, and fum, which wildcard pattern matches all of them except "fat"?



20.  

Identify the command to display the value of the variable TMPDIR.

Note: answer choices in this exercise are randomized.

© 1999-2000 by Prentice-Hall, Inc.
A Pearson Company
Distance Learning at Prentice Hall
Legal Notice