sInfoEra
Home
MCQs
Unix/Lunux — Learn
Unix MCQ Set 02
Review each question and reveal answers to strengthen your understanding
Home
/
MCQs
/
Unix MCQ Set 02
1
Which command is used with vi editor scroll half page backward?
A
[Control-d]
B
[Control - u]
C
Control-(c]
D
[Control -P]
Show Answer
✅ Correct Answer: 2
2
Which command is used to terminate a process?
A
shutdown
B
haltsys
C
cancel
D
kill
Show Answer
✅ Correct Answer: 4
3
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?
A
who | tee user.lst
B
who > user.lst
C
who >> user.lst
D
who < user.lste
Show Answer
✅ Correct Answer: 1
4
Which command is used to display the top of the file?
A
cat
B
head
C
more
D
grep
Show Answer
✅ Correct Answer: 2
5
The first set of the three permissions (rw) pertains to the owner of the file, indicating that the owner has
A
Executable permission only
B
Write and executable permissions
C
Both read and executable permissions
D
Both read and write permissions
Show Answer
✅ Correct Answer: 4
6
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
Show Answer
✅ Correct Answer: 2
7
Which option will be used with disk free command to include the total amount of disk space in the file system?
A
-t
B
-tt
C
-4
D
-i
Show Answer
✅ Correct Answer: 1
8
Which command allows you to view your file 24 lines at a time?
A
more
B
pg
C
cat
D
lp
Show Answer
✅ Correct Answer: 2
9
Which command is used to display the characteristics of a process?
A
pid
B
du
C
ps
D
au
Show Answer
✅ Correct Answer: 3
10
Which of the following keys is used to overstrike a whole line?
A
R
B
v
C
C
D
u
Show Answer
✅ Correct Answer: 1
11
Which option will be used with ps command to show the entire command line of the process being run?
A
-4
B
-f
C
-1
D
-2
Show Answer
✅ Correct Answer: 2
12
Which command is used to list all the files with extension .lst?
A
ls -l *.lst
B
ls lst*
C
ls *.*
D
ls *[lst]
Show Answer
✅ Correct Answer: 1
13
Which of the following special shell variables is used to process number of the current shell?
A
$!
B
$$
C
$0
D
$*
Show Answer
✅ Correct Answer: 2
14
Which option will be used with touch command to change the access time?
A
-a
B
-b
C
-t
D
-h
Show Answer
✅ Correct Answer: 1
15
Which command is used with vi editor to search a pattern in the forward direction?
A
/
B
?
C
//
D
??
Show Answer
✅ Correct Answer: 1
16
Which command is used with vi editor to move the cursor to the left?
A
i
B
j
C
k
D
h
Show Answer
✅ Correct Answer: 4
17
Which command is used to change protection mode of files starting with the string emp and ending with 1,2, or 3?
A
chmod u+x emp[1-3]
B
chmod 777 emp*
C
chmod u+r ??? emp
D
chmod 222 emp?
Show Answer
✅ Correct Answer: 1
18
Which command is used to change directory to the name beginning with a 'p'?
A
cd p
B
cd p?
C
cd p*
D
cd [p]
Show Answer
✅ Correct Answer: 3
19
Which command is used with vi editor to move cursor forward to first occurrence of character 'ch' in the current line?
A
tch
B
tch
C
rch
D
ech
Show Answer
✅ Correct Answer: 2
20
The command to count the number of files in the current directory by using pipes, is
A
ls | wc
B
ls -l | wc -l
C
ls | wc -w
D
ls | ws -c
Show Answer
✅ Correct Answer: 3
21
Which symbol is used to separate more than one command in the same command line?
A
$
B
#
C
:
D
;
Show Answer
✅ Correct Answer: 4
22
Which of the following commands is used to remove files?
A
erase
B
delete
C
rm
D
dm
Show Answer
✅ Correct Answer: 3
23
The command chmod 761 note is equivalent to
A
chmod 167 note
B
chmod u=rwx, g=rw, o=x note
C
chmo a =761 note
D
chmod 4=7, g=6,0 =1 note
Show Answer
✅ Correct Answer: 2
24
Which of the following commands is used to display the filenames in multiple columns?
A
ls
B
ls -1
C
ls -x
D
lc
Show Answer
✅ Correct Answer: 3
25
The field separator in cut command is specified with
A
-a option
B
-d option
C
-r option
D
-x option
Show Answer
✅ Correct Answer: 2
26
Which command is used to print a file?
A
print
B
prn
C
pg
D
lp
Show Answer
✅ Correct Answer: 4
27
Which of the following keys is used to move the cursor to the end of the paragraph.
A
}
B
{
C
|
D
$
Show Answer
✅ Correct Answer: 1
28
Which of the following set options is used with vi editor to ignore case while searching for patterns?
A
ic
B
ai
C
sm
D
ts
Show Answer
✅ Correct Answer: 1
29
Which of the following commands is used to view your file 24 lines at a time?
A
pg
B
cat
C
lp
D
/p
Show Answer
✅ Correct Answer: 1
30
Which of the following directories contain all the Alias created by a user, including his login directory?
A
/tmp
B
/etc
C
/usr
D
/dev
Show Answer
✅ Correct Answer: 3
31
Which command is used to display and create files?
A
cat
B
vi
C
ed
D
lyrix
Show Answer
✅ Correct Answer: 1
32
In Bourne shell, which file sets the Unix environment for the user when the logs into his HOME directory.
A
.exrc
B
.profile
C
lastlogin
D
.mbox
Show Answer
✅ Correct Answer: 2
33
Which of the following commands is used to display the directory attributes rather than its contents?
A
ls -l -d
B
ls -l
C
ls -x
D
ls -F
Show Answer
✅ Correct Answer: 1
34
Which of the following commands is used to summarize the disk usage?
A
chkdsk
B
fdisk
C
du
D
disk
Show Answer
✅ Correct Answer: 3
35
The agency that sits between the user and the UNIX system is called the
A
logic
B
profile
C
shell
D
erxc
Show Answer
✅ Correct Answer: 3
36
Which command is used to remove a directory?
A
rd
B
rmdir
C
dldir
D
rdir
Show Answer
✅ Correct Answer: 2
Back to All Quizzes