R4RIN
MCQS
Unix/Lunux MCQ Quiz Hub
Unix MCQ Set 01
Choose a topic to test your knowledge and improve your Unix/Lunux skills
1. The first set of the three permissions (rw) pertains to the owner of the file, indicating that the owner has
executable permission only
Write and executable permissions
Write and executable permissions
Both read and write permissions
2. Which of the following commands is used to obtain a list of all files by modification time?
ls -1
ls -t
ls -i
ls -r
3. Which option will be used with disk free command to include the total amount of disk space in the file system?
-t
-tt
-4
-i
4. Which command is used to terminate all processes in your own system except the login shell?
kill 1
kill-o
cancel all
cancel 1
5. Which of the following commands is used to display your working directory?
dir
prompt $p$g
pwd
path
6. Which of the following commands is used to rename a file?
rename
remove
mv
ren
7. Which command is used to save the standard output in a file, as well as display it on the terminal?
more
cat
grep
tee
8. Which command is used to copy all files having the string chap and any two characters after that to the progs directory?
cp chap?? progs
cp chap* progs
cp chap[12] /progs/*.*
cp chap?? /progs/*
9. Which command will be used with vi editor to replace single character under cursor with any number of characters?
s
S
a
i
10. Which symbol will be used with grep command to match the pattern pat at the end of a line?
^pat
$pat
pat$
pat^
11. The Octal number to be given along with chmod command to make a file readable, writable and executable to the owner, readable and executable to group and others is:
000
755
744
555
12. Which of the following commands is used to get directory one level up?
cd
cd ..
cd/
chdir
13. The cat command is used to
Capture a file
Display a file
Print a file
Print a file
14. Which command is used to count just the number of characters in a file?
wc - 1
wc -c
wc -w
wc -r
15. Which command is used to display the end of the file?
head - r
tail
eof
bof
16. Which of following commands is used for an automatic reminder service?
write
mesg
calendar
mail
17. While working with mail command, which command is used to save mail in a separate file?
s
r
w
d
18. Which of the following commands can be used to get information about yourself?
who am i
i /4
pwd
which
19. Which of the following keys is used to delete the character beneath the cursor?
x
X
dd
D
20. The cp command uses:
Standard input file
Standard output file
Both input and output file
Neither standard input nor standard output file
21. Which command is used to locate all the .profile files in the system?
ls profile
find /-name profile -print
cd /.profile
l -u .profile
22. Which command is used to display all the lines with the string 'sales' from the file empl.lst?
cut sales empl.lst
/sales > empl.lst
grep sales empl.lst
cat | /sales > empl.lst
23. Which of the following files contains information related to password aging?
Shadow
Password
Profile
All the three
24. The [line number G] key allows you
To move cursor left by one position
To move cursor right by one position
To move cursor down by one line
To move cursor to the beginning of the line specified by the number
25. Which command sends the word count of the file infile to the newfile.
wc infile >newfile
wc <infile >newfile
wc infile - newfile
wc infile | newfile
26. Which option is used with the chmod command recursively to all files and sub-directories in a directory?
-l
-i
-x
-R
27. The special shell variable $* is used
To exit status of last command executed
To process number of the current shell
To list the positional parameters
To name the command being executed
28. Which of the following is not a communication command?
write
mesg
mail
grep
29. Which set option is used with vi editor to display line numbers on screen?
nm
nu
ic
li
30. Which of the following signs is used to back up over typing errors in vi?
@
#
$
!
31. The command which transcribes the standard input to the standard output and also makes a copy of the same in a file is
tee
tr
sort
grep
32. Which command is used to list out all the hidden files along with the other files?
ls -l
ls -x
ls -F
ls -a
33. The octal representation 652 indicates
Execute permission for the owner
Write permission for others
Read and write permission of groups
None of the above
34. Which of the following commands is used to list contents of directories?
ls
lp
dir
tar
35. 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
36. The command that can be used to restrict incoming messages to a user is
mesg
grep
halt
sleep
37. In vi editor, forward search is performed using the command.
:pat
?pat
/pat
None of the above
38. Which of the following commands is used to change the working directory?
cd
changedir
chdir
cdir
39. Which option is used with cmp command to give a detailed list of the byte number and the differing bytes in octal for each character that differs in both the files?
-l
-d
-r
-b
40. The % key allows you
To move the cursor to a matching delimiter, when a delimiters a parenthesis, a bracket, or a brace
To move the cursor to the upper left corner of the screen
To move the cursor backward to the beginning of a word
To move the cursor to the first column in the current line
41. 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
42. Which command will be used with vi editor to append text at end of line?
A
a
i
l
43. Which command is used to make all files and sub-directories in the directory (progs) executable by all users?
chmod -R a+x progs
chmod -R 222 progs
chmod -1 a+x progs
chmod -x a+x progs
44. Which command is used to sort the lines of data in a file in alphabetical order?
sort
sh
st
sort -r
45. Which of the following shell's wildcards are used to match any number of characters including none?
[ijk]
!ijk]
?
*
46. Which column contains all details of the permissions of a file when you issue the ls -l command?
Second
Fourth
Third
First
47. Which is the earliest and most widely used shell that came with the UNIX system?
shell
Korn shell
Bourne shell
Smith shell
48. You can append to a file instead of overwriting by using the
> symbols
>> symbols
< symbols
<< symbols
49. You can append to a file instead of overwriting by using the
> symbols
>> symbols
< symbols
<< symbols
50. Which option will be used with sort command to start sorting ofter the nth column of the (m+l)th field?
-m.n
+m.n
+ n.m+1
+(m+l).n
51. The ls -l command tells
Who the owner of the file is
The name of the group owner of the file
How large the file is and when the file was last modified
All of the above
52. The UNIX file system stores a data in physical blocks of
1024 bytes
2048 bytes
512 bytes
256 bytes
53. Which command is used to sort the lines of data in a file in reverse order
sort
sh
st
sort -r
54. Which of the following commands can be used to get information about all users who are currently logged into the system?
which
who
who am
1 /u
55. Which of are following internal commands is used in mail to forward mail to user in user-list?
r user-list
m user-list
d user-list
e user-list
56. Which command is used to extract specific columns from the file?
cat
cut
grep
paste
57. Which of the following is not a filter?
cat
grep
wc
None of the above
58. Which of the following command is used to count just the number of lines contained in a file?
wc -l
wc -c
wc -w
wc -r
59. Which of the following files will displayed by this command cat *ch*
patch
catch
ch
All of the above
60. Which of the following command is used to count just the number of lines contained in a file?
wc -l
wc -c
wc -w
wc -r
61. Which of the following files will displayed by this command cat *ch*
patch
catch
ch
All of the above
62. Which of the following is invalid filename?
shutry
TRY
trial
None of the above
63. Which of the following commands is used to copy directory structures in and out
cp
cpio
cp - p
copy
64. Which of the following commands is used to copy directory structures in and out
cp
cpio
cp - p
copy
65. Which command is used to remove a file?
remove
rm
mv
del
66. 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
67. 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
68. Which command is used to assign only read permission to all three categories of the file 'note'?
chmod go+r note
chmod a-rw
chmod ugo=r note
chmod u+r,g+r,o-x note
69. Which command is used to display a file contents in octal form?
cd
od
of
oct
70. 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
71. Which command is used with vi editor to save file and remain in the editing mode?
:q
w
q!
:x
72. Which of the following command addresses all users who are currently hooked on?
write
mail
wall
mesg
73. Which of the following commands is used to remove files with confirmation prompt from the user file system which have neither been accessed nor modified i the last one year?
find -mtime +365 | rm
grep (/usr/*) - mtime + 365 | -ok rm
find -name - mtime + 365 / - ok rm
find /user/* (-mtime + 365 - a - atime +365 ) - OK rm {} ;
74. Which command is used to link the files?
lk
ln
cp
tar
75. Which of the following commands is used to identify the type of file by context?
ls
cat
file
more
76. Which command is used to copy a file wb with the same name from the programs directory to the misc directory?
copy programs/wb misc/wb
cp programs/wb misc
tar programs/wb misc/wb
copy a:programs/wb b:misc/wb
77. Which of the following command is used to go to home directory?
cd..
cd
cd
cd HOME
78. The second set of the three permissions (r-) indicates that
Group has read permission only (B) (C) (D)
Other has read permission only
Owner has read permission only
Group has write permission only
79. Which command is used to set the three permissions for all the three categories of users of a file?
chgrp
chown
chmod
chusr
Submit