Olete.in
Articles
Mock Tests
🧪 Unix/Lunux MCQ Quiz Hub
Unix MCQS Set 2
Choose a topic to test your knowledge and improve your Unix/Lunux skills
1. Which of the following files contains information related to password aging?
Shadow
password
profile
All the three
2. Which command will be used with vi editor to replace text from cursor to right?
r
R
s
S
3. Which of the following commands is used to rename a file?
rename
remove
mv
ren
4. Which of the following is not a filter?
cat
grep
wc
None of the above
5. Which of the following commands is used to copy a file wb from the programs directory into a file called wbx in the misc directory?
copy programs/wb misc/wbx
cp programs/wb misc/wbx
tar programs/wb misc/wbx
copy a:programs/wb b:misc/wbx
6. Which command is used to list all the files with extension .lst?
ls -l *.lst
ls lst*
ls *.*
ls *[lst]
7. Which command is used to change directory to the name beginning with a 'p'?
cd p
cd p?
cd p*
cd [p]
8. Which of the following is invalid filename?
shutry
TRY
trial
None of the above
9. Which commands is used to assign executable permission to all of the files named "letter"?
chmod ugo+r letter
chmod ugo+rw letter
chmod u+x letter
chmod ugo+x letter
10. Which set option is used with vi editor to display line numbers on screen?
nm
nu
ic
li
11. Which command is used to print a file?
print
prn
pg
lp
12. Which command will be used with vi editor to replace single character under cursor with any number of characters?
s
S
a
i
13. Which of the following set options is used with vi editor to ignore case while searching for patterns?
ic
ai
sm
ts
14. Which command is used to list out all the hidden files along with the other files?
ls -l
ls -x
ls -F
ls -a
15. Which of the following commands is used to absolutely assign all permissions to the owner, read and write permissions to the group and only executable permission to the others of the file note?
chmod 761 note
chmod 671 note
chmod 167 note
chmod 4=rwx, g=rw note
16. The chmod ugo+rw note command can be represented in octal notation as
chmod 555 note
chmod 666 note
chmod 444 note
chmod 333 note
17. Which of the following commands is used to display the filenames in multiple columns with indication of directories and executable file?
ls -F -x
ls -l
ls ~ x
Ip
18. Which command is used with vi editor to search a pattern in the forward direction?
/
?
//
??
19. Which of the following commands is used to assign executable permission to the owner of the file named "note"?
chmod g+x note
chmod u+w note
chmod u+x note
chmod ugo+x note
20. The command to count the number of files in the current directory by using pipes, is
ls | wc
ls -l | wc -l
ls | wc -w
ls | ws -c
21. Which of the following commands is used to get directory one level up?
cd
cd ..
cd/
chdir
22. Which of the following commands is used to count the total number of lines, words, and characters contained in a file.
count p
wc
wcount
countw
23. Which command is used to delete all files in the current directory as well as all files and sub-directories in its subdirectories?
rm *
rm -r *
rm all
rm *.*
24. Which of the following commands is used to change the working directory?
cd
changedir
chdir
cdir
25. Which of the following commands is used to view your file 24 lines at a time?
pg
cat
lp
/p
26. Which shell's wild-cards is used to match a single character?
*
?
[ijk]
[!ijk]
27. In Bourne shell, which file sets the Unix environment for the user when the logs into his HOME directory.
.exrc
.profile
lastlogin
.mbox
28. Which command is used to copy the three files wb, collect and mon into the misc directory, under the same, when you were currently in the programs directory?
copy wb ../misc collect ../misc mon ../misc
cp wb collect mon ../misc
copy wb collect mon /misc
tar wb collect mon /misc
29. The command chmod 761 note is equivalent to
chmod 167 note
chmod u=rwx, g=rw, o=x note
chmo a =761 note
chmod 4=7, g=6,0 =1 note
30. The commonly used UNIX commands like date, ls, cat, etc. are stored in
/dev directory
/bin and /usr/bin directories
/tmp directory
/unix directory
Submit