R4RIN
MCQS
Unix/Lunux MCQ Quiz Hub
Unix MCQ
Choose a topic to test your knowledge and improve your Unix/Lunux skills
1. What is Unix?
Unix is a programming language
Unix is a software program
Unix is an operating system
Unix is a text editor
2. The Unix shell is both _______ and _______ language.
scripting, interpreter
high level, low level
interactive, responsive
interpreter, executing
3. In which language UNIX is written?
C++
C
JAVA
Python
4. Which of the following is the first UNIX editor?
vi
emacs
ed
ed
5. Which of the following is not a feature of Unix?
multiuser
easy to use
multitasking
portability
6. Which of the following is not true about Unix?
UNIX was not written in ‘C’ language
Linux is also known as a version of UNIX
A user can run multiple programs at the same time; hence UNIX is called a multitasking environment
Many people can use a UNIX based computer at the same time; hence UNIX is called as a multiuser system
7. Which editor is used by the Unix system to edit files?
word
notepad++
vi
notepad
8. Which of the following is not a part of all the versions of Unix?
System Calls
Graphical user interface
Kernel and Shell
Commands and utilities
9. Which part of the Unix operating system interacts with the hardware?
Application program
Vi editor
Shell
Kernel
10. Which command is used to display the documentation of commands in Unix?
man
whatis
help
search
11. Which Unix command is used for changing the current directory?
pwd
rm
cd
cp
12. Which command is used for printing the current working directory?
dir
HOME
cd
pwd
13. Which command is used for listing files in a directory?
list
ls
wc
ps
14. Which command is used by the user to change their login password in Unix?
cp
man
reset
passwd
15. Which command is used for displaying the contents of a file in Unix?
mkdir
cat
rm
cp
16. Which command is used to compress files?
gzip
gunzip
comm
cmp
17. Which command is used for displaying the beginning of a file in Unix?
lp
begin
pr
head
18. Which symbol is used with the tail command to print the file from the selected line? d)
%%
^
+
–
19. Which command is used to delete all files in a directory?
del *
rm *
mv *
rmdir *
20. echo command is used for _________
displaying diagnostic messages
displaying date and time
displaying errors
displaying operating system details
21. What is the function of cp command in Unix?
delete a given file
change the directory
list all the available files in the current directory
cp is a command used for copying files and directories
22. Which command is used for removing/deleting files in Unix?
rm
mv
rmdir
del
23. Which command is used for renaming files in Unix?
rename
move
mv
cp
24. Which command is used for comparing two files?
comp
cmp
comm
diff
25. Which Unix command is used for counting words, lines, and characters in a file?
wc
man
count
diff
26. Which command is used for saving and quitting the vi editor simultaneously?
‘:x’
:f
:q
:w
27. How can we escape to the UNIX shell without quitting vi editor?
using ‘:sh’ command and using ctrl-Z
using ‘:sh’ command
using ctrl-Z
using ctrl-D
28. Which of the following files are known as special files in Unix?
/dev/null
sample.txt
/dev/null and /dev/tty
/dev/tty
29. What is the output of the following Unix command? $ wc -c *.c
size of each .c file
total size of .c files
erroneous
undefined
30. In Unix, for what purpose bc command is used?
for copying files
as a process table viewer
as an editor
as a calculator
31. Which process is immediately set up by the kernel when we log on to a Unix system?
System
bash
shell
parent
32. Which command shows some attributes of a process?
HOME
ps
$$
pid
33. Which of the following system call is used for creating a new process in Unix?
new
wait
read
fork
34. Which Unix command is used for locating files?
type
loc
find
search
35. Which command is used for preparing a file for printing?
pr
print
cat
cd
36. Which command is used for sorting a file on specified fields?
pr
cut
tail
sort
37. Which Unix command is used for locating repeated and non-repeated lines?
cut
paste
uniq
sort
38. Which command is used for translating characters?
paste
tr
trans
sort
39. Which of the following command will be used for searching “director” in emp.lst?
grep “director” emp.lst
grep -director emp.lst
grep -v “director” emp.lst
grep “director”
40. Which of the following command is used for searching for a pattern in one or more file(s)?
paste
grep
cd
cp
41. Which of the following commands is known as stream editor?
grep
tr
sed
td
42. What is a shell script?
group of functions
a file containing a series of commands
a file containing special symbols
group of commands
43. To run the script, we should make it executable first by using _____
chmod +w
chmod +rwx
chmod +x
chmod +r
44. Which command is used to find out the consumption of a specific directory?
mem
dv
du
df
45. Which filter apart from perl, is the most powerful?
awk
grep
cut
sed
46. Which filter apart from perl, is the most powerful?
awk
grep
cut
sed
47. For running a Unix command within awk, we’ve to use ____ function.
split
system
substr
length
48. To extract specific columns from a file ____ command is used.
cut
pr
head
tail
49. Which of the following cannot be performed by cat command?
appending files
deleting files
creating files
displaying files
50. What is the default delimiter used by the cut command for cutting fields?
space
underscore
tab
double tab
51. Which of the following is not an internal command used by mailx?
d
N
a
q
52. Which command is used for printing the current working directory?
HOME
cd
pwd
dir
53. Which command is used for changing the current directory?
cd
cp
pwd
rm
54. Which command is used for creating directories?
rmdir
mkdir
cd
cp
55. Which command is used for creating directories?
rmdir
mkdir
cd
cp
56. What does the following command do? $ mkdir dir dir/dir_01/dir_02
create dir, dir_01 and dir_02
creates dir_02
creates dir only
throws an error
57. Sometimes we are unable to create a directory because ______________
the directory may already exist in the current directory
there may be an ordinary file by the same name in the current directory
the permissions set for the current directory does not allow the creation
the directory may exist, there may be an ordinary file, the permissions set for the current directory does not allow the creation
58. Which command is used for removing an empty directory?
mkdir
rmdir
del
remove
59. If rmdir dir001 fails, what could be the reason(s)?
dir001 doesn’t exist
dir001 is not empty
permissions of dir001 doesn’t allow to remove it
dir001 doesn’t exist, dir001 is not empty and permissions of dir001 doesn’t allow to remove it
60. Which of the following keys is used to replace a single character with new text?
S
s
r
C
61. $ cp file_01 . copies the file named file_01 in ____ directory
current
parent
root
user
62. The output of the following command is __________ $ cp abd/ .user_06
copies .user_06 file in current directory
copies .user_06 file in parent directory of directory named abd
undefined behaviour
erroneous output
63. For moving two level up in the file hierarchy system using cd command once, we separates ( . . ) by which symbol?
?
$
*
/
64. Which command is used for listing files in a directory?
ps
list
ls
wc
65. Which option is used with ls command for long listing of files with seven attributes?
-a
-l
-x
-i
Submit