R4RIN
Articles
Java 8
MCQS
Unix/Lunux MCQ Quiz Hub
Unix MCQS Set 4
Choose a topic to test your knowledge and improve your Unix/Lunux skills
1. The File that contains a set of instructions which are performed when a user logs in, is
autoexec.bat
.exrc
.profile
.autoexec
2. The octal representation 652 indicates
Execute permission for the owner
Write permission for others
Read and write permission of groups
All of the above
3. 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
4. Which of the following command is used to go to home directory?
cd..
cd/
cd
cd HOME.
5. Which command is used to move all files to the bin sub-directory of the parent directory?
mv *.* /bin/
mv * /bin/*
mv * ../bin
mv * ../bin *.*
6. Which command is used to save the standard output in a file, as well as display it on the terminal?
more
cat
grep
tee
7. The command that can be used to restrict incoming messages to a user is
mesg
grep
halt
sleep
8. Which of the following commands is used to copy directory structures in and out
cp
cpio
cp - p
copy
9. Which of following commands is used for an automatic reminder service?
write
mesg
calendar
mail
10. Which command allows you to view your file 24 lines at a
more
pg
cat
lp
11. Which of the following special shell variables is used to process number of the current shell?
$!
$$
$0
$*
12. Which command is used with vi editor scroll half page backward?
[Control-d]
[Control - u]
[Control-c]
[Control -P]
13. Which command is used with vi editor to move cursor forward to first occurrence of character 'ch' in the current line?
tch
fch
rch
ech
14. Which of the following keys is used to delete the character beneath the cursor?
x
X
dd
D
15. 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
16. Which command will be used with vi editor to append text at end of line?
A
a
i
I
17. 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
both read and executable permissions.
both read and write permissions
18. Which of the following commands is used to save the output of the who command in a file named user.lst, as well as display it?
who | tee user.lst
who > user.lst
who >> user.lst
who < user.lste
19. Which of the following shell's wildcards are used to match any number of characters including none?
[ijk]
[!ijk]
?
*
20. The command used to remove the directory is;
rmdir
rd
remove
rdir
21. Which symbol will be used with grep command to match the pattern pat at the end of a line?
^pat
$pat
pat$
pat^
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 commands is not the vi Input mode command?
rch
R
S
j
24. Which of the following commands is used to remove files?
erase
delete
rm
dm
25. Which command is used with vi editor to save file and remain in the editing mode?
:q
:w
q!
:x
26. You can append to a file instead of overwriting by using the
> symbols
>> symbols
< symbols
<< symbols
27. 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
28. Which of the following commands is used to have a two-way communication with any person who is currently logged in?
mail
mesg
write
grep
29. Which command is used with vi editor to move the cursor to the left?
i
j
k
h
30. Which of command is used to copy a file?
copy
cp
cpio
tar
31. The special shell variable $* is used
to exit status of ast command executed.
to process number of the current shell
to list the positional parameters
to name the command being executed
32. The cat command is used to
capture a file
display a file
print a file
copy a file
33. The UNIX file system stores a data in physical blocks of
1024 bytes
2048 bytes
512 bytes
256 bytes
34. Which command is used to terminate all processes in your own system except the login shell?
kill 1
kill 0
cancel all
cancel 1
35. Which operator will be used with chmod command to assign absolute permission?
+
-
=
%
36. Which command is used to link the files?
lk
ln
cp
tar
37. Which of the following signs is used to back up over typing errors in vi?
@
#
$
!
38. 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
39. 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
40. Which of the following commands is used to display the filenames in multiple columns?
ls
ls -1
ls -x
lc
41. Which command is used with file named 'note' to remove the executable permission from the user and assign read permission to the group and others?
chmod u-x, go+r note
chmod go+r, u+x note
chmod g-x, uo+r note
chmod go+x, u-x note
Submit