Must Read - Unix - Questions
Must Read - Unix - Questions
1. How can you display a list of all files, including the hidden files?
a) Ls –a
b) Find –a
c) All
d) Find all
2. With what command can you see which folder you are in?
a) whereami
b) place
c) map
d) pwd
3. How do you get all files in a directory with on the 3rd place has an r,g,or i?
a) ls *[rgi]*
b) ls?3[rgi]*
c) ls[..i*]
d) ls**[rgi]?
e) ls??[rgi]*
4. How can you store and append the directory listing (files and directories) in a file
named “filecontent”?
a) ls <>filecontent
b) ls <filecontent
c) ls>>filecontent
d) ls>filecontent
a) 2> error.log
b) 2>/dev/null
c) &>error.log
d) 1>error.log
9. Which command is used to copy all files having the string chap and any two
characters after that to the progs directory?
a) cp chap?? progs
b) cp chap* progs
c) cp chap[12] /progs/*.*
d) cp chap?? /progs/*
e) None of the above
10. Which command sends the word count of the file infile to the newfile.
a) wc infile >newfile
b) wc <infile >newfile
c) wc infile - newfile
d) wc infile | newfile
e) None of the above
11. Which command is used to remove the read permission of the file 'note' from both
the group and others?
a) chmod go+r note
b) chmod go+rw note
c) chmod go-x note
d) chmod go-r, 4-x note
e) None of the above
13: Which of the following commands is used to obtain a list of all files by modification
time?
a) ls -1
b) ls -t
c) ls -i
d) ls -R
e) None of the above
14:Which option will be used with touch command to change the access time?
a) -a
b) -b
c) -t
d) -h
e) None of the above