You are on page 1of 2

1.

How do you change the access permission (add group read/write) to all the files in
the current directory containing the word cali in their names?
a. chmod g+rw *cali*
b. setperm r+w *cali*
c. chmod 0060 *cali*
2. What is the command to find the differences in the lines containing 1999 between
the files orig.txt and copy.txt, and add the result to file result.1999?
a. diff orig.txt d copy.txt | grep 1999 > result.1999
b. diff orig.txt copy.txt | grep 1999 >> result.1999
c. grep 1999 *.txt >> result.199
3. Create a new file new.txt that is a concatenation of file1.txt and file2.txt
a. cat file1.txt file2.txt > new.txt
b. make new.txt=file1.txt+file2.txt
c. tail file.txt | head file2.txt > new.txt

4. What is the command to search all files in your current directory for the word
apple?
a. grep apple*
b. find apple all
c. lookup apple
d. where apple
5.
a.
b.
c.

How do you print the first 15 lines of all files ending by .txt?
print 15 .txt
cat *.txt length=15
head -15 *.txt

6. Make a copy of file upper in the directory two levels up.


a. jump -2 upper
b. cp upper ../..
c. cp upper -2/
7. Count the files you own in all your directories.
a. ls IR | grep myusername | wc l
b. ls a | cnt*
c. ls n ~myusername
8. Change the current directory to /usr/local/bin
a. mv /usr/local/bin.
b. cd /usr/local/bin.
c. Setdir /usr/local/bin.

9. Which command is used to change your password?


b. pass
c. passwd
d. pwd
10. Which command will display a calendar?
a. cal
b. dis cal

c. view cal
d. calendar
3. Which command can be used to display the contents of a file on the screen?
a. ls
b. grep
c. dog
d. cat
4. Which command allows you to determine if a host is connected to the internet?
a. ls-la
b. cmd
c. pwd
d. ping
5. Which command would you use to create a sub-directory in your home directory?
a. mkdir
b. dir
c. cp
d. rm
6. The wc command will report all misspelled words.
a. True
b. False
7. To change access modes on files you can use the chmod command.
a. True
b. False
8. To change the owner of the file you could use the chowned command.
a. True
b. False
9. head is the command that writes the first 10 lines of a file to the screen.
10. The pwd_ command will display the absolute pathname for the directory that
you are working in.

You might also like