Explore topic-wise MCQs in Unix.

This section includes 358 Mcqs, each offering curated multiple-choice questions to sharpen your Unix knowledge and support exam preparation. Choose a topic below to get started.

251.

___ searches for a first instance of a pattern in forwarding direction

A. /
B. %
C. &
D. ?
Answer» B. %
252.

__ command allows us to undo a number of changes that have been made to a single line before moving away from that line.

A. u
B. U
C. dd
D. yy
Answer» C. dd
253.

To copy 10 lines from the current cursor location, we can use ____

A. 10y
B. 10yy
C. yy10
D. 10x
Answer» C. yy10
254.

To copy (yank) lines in vi editor, we use ______ command.

A. dd
B. x
C. p
D. yy
Answer» E.
255.

Which of the following commands of ex-mode is equivalent to ‘G’ command in command mode?

A. : .
B. : $
C. : %
D. :w
Answer» C. : %
256.

Which key is used for absolute movement?

A. f
B. G
C. M
D. ctrl-g
Answer» D. ctrl-g
257.

___ command moves the cursor to the end of next line.

A. 0
B. |
C. %
D. $
Answer» E.
258.

Using ‘w’ command we can _________

A. move back to the beginning of the word
B. move forward to the end of the word
C. move forward to the beginning of the word
D. move back to the end of the word
Answer» D. move back to the end of the word
259.

Using ‘b’ command we can _________

A. move back to the beginning of the word
B. move forward to the end of the word
C. move forward to the beginning of the word
D. move back to the end of the word
Answer» B. move forward to the end of the word
260.

Using ‘e’ command we can __________

A. move back to the beginning of the word
B. move forward to the end of the word
C. move forward to the beginning of the word
D. move back to the end of the word
Answer» C. move forward to the beginning of the word
261.

To recover from a crash, we can use ____ command.

A. :recover
B. -r
C. : x
D. :recover and -r
Answer» E.
262.

To return back to the editor from shell prompt we use _____ command.

A. fg
B. exit
C. back
D. fg and exit
Answer» E.
263.

In ex-mode, current line is represented by __

A. :
B. $
C. >
D. .
Answer» E.
264.

In ex-mode, last line is represented by _

A. :
B. $
C. >
D. .
Answer» B. $
265.

Which command is used to abort the editing and quit the editing mode?

A. :w
B. :wq
C. :q
D. ‘:x’
Answer» D. ‘:x’
266.

Which of the following command is a substitute for ‘:x’ command?

A. ‘:x’
B. :wq
C. :q
D. :w
Answer» C. :q
267.

Which one of the following is the best way for saving and quitting the editor?

A. ZZ
B. :wq
C. :w
D. ‘:x’
Answer» B. :wq
268.

Pressing ‘:’ in command mode invokes which mode of vi editor?

A. ex-mode
B. insert mode
C. command mode
D. input mode
Answer» B. insert mode
269.

To replace the entire line irrespective of cursor position, we can use ____ command

A. s
B. 10s
C. S
D. 10S
Answer» D. 10S
270.

To replace 5 characters with new characters, which one of the following will be used?

A. s
B. 5S
C. 5s
D. S
Answer» D. S
271.

To replace all text on the right of the cursor position, we use ____ command.

A. r
B. R
C. s
D. l
Answer» C. s
272.

Which one of the following command is used to replace a single character with many?

A. s
B. r
C. R
D. S
Answer» B. r
273.

Input mode is used for ______

A. editing text in files
B. invoking commands on files
C. saving files
D. performing substitution
Answer» B. invoking commands on files
274.

One of the most important features of vi editor is _____

A. available mostly across all UNIX platforms
B. easy to learn
C. latest editor
D. powerful than other editors
Answer» B. easy to learn
275.

The first UNIX editor was __

A. emacs
B. ex
C. ed
D. vi
Answer» D. vi
276.

While entering text in input mode the data is saved in ___

A. buffer
B. disk
C. RAM
D. cache
Answer» B. disk
277.

___ key is used for switching to command mode from input mode.

A. i
B. A
C. :
D. esc
Answer» E.
278.

Which one of the following key is used to switch from command mode to input mode?

A. i
B. :
C. esc
D. ;
Answer» B. :
279.

Which symbol is used to change permissions for hidden files?

A. .
B. &
C. $
D. *
Answer» B. &
280.

Like chmod, chown and chgrp can also use ___ option.

A. -R
B. -r
C. -x
D. -i
Answer» B. -r
281.

Which command is used to change the group owner of the file?

A. chown
B. ch
C. chgrp
D. chmod
Answer» D. chmod
282.

Which character is used to replace ‘ugo’ string in chmod command?

A. a
B. v
C. x
D. o
Answer» B. v
283.

To remove write permission from group and others, which one of the following commands will be used?

A. chmod go+w file01
B. chmod go-w file01
C. chmod ug-w file01
D. chmod a-w file01
Answer» C. chmod ug-w file01
284.

A file owner does not have a permission to edit the file but the group to which the file owner belong do have the permission to edit it. Can owner edit the file?

A. Yes
B. No
C. Cannot be defined
D. Error will be encountered
Answer» C. Cannot be defined
285.

The write permission for a directory determines that ______

A. we can write to a directory file
B. we can read the directory file
C. we can execute the directory file
D. we can add or remove files to it
Answer» E.
286.

A file contains 1026 bytes. How many bytes of disk space will it consume if size of a disk block is 1024 bytes?

A. 1026
B. 1024
C. 2048
D. 4096
Answer» D. 4096
287.

Which option is used with unzip command to view the contents of a compressed archive?

A. -v
B. -t
C. -c
D. -x
Answer» B. -t
288.

Which command is used for unzipping files which are compressed using zip command?

A. gunzip
B. gzip
C. unzip
D. guzip
Answer» D. guzip
289.

o create an archive named abc.tar consisting of two files, file01 and file02, which of the following command will be used?

A. tar –cvf abc.tar file01 file02
B. tar –cvf file01 file02 abc.tar
C. tar –cv abc.tar file01 file02
D. tar –c abc.tar file01 file02
Answer» C. tar –cv abc.tar file01 file02
290.

Which of the following is an archival program?

A. arch
B. archive
C. ar
D. tar
Answer» E.
291.

Which of the following key options is used with tar to create an archive?

A. -c
B. -x
C. -t
D. –f archive name
Answer» B. -x
292.

Which of the following is not an internal command for more?

A. q
B. f
C. b
D. z
Answer» E.
293.

UNIX offers a pager named ____ which has replaced the original pager of UNIX called ____

A. more, less
B. less, more
C. more, pg
D. pg, more
Answer» D. pg, more
294.

Which option is used for printing multiple copies of a file using lp command?

A. -l
B. -i
C. -t
D. -n
Answer» E.
295.

Which option is used with lp command if there are more than one printers in the system?

A. -t
B. -d
C. -i
D. -p
Answer» C. -i
296.

Which option is used for counting the number of characters in a file only.

A. -l
B. -w
C. -c
D. -w
Answer» D. -w
297.

Which command is used for printing a file?

A. lp
B. pr
C. pg
D. more
Answer» B. pr
298.

Which option is used for counting the number of words in a file only?

A. -l
B. -w
C. -c
D. -W
Answer» E.
299.

When two files are identical, what is the output of diff command?

A. Files are identical
B. Returns prompt
C. No output
D. Throws an error
Answer» C. No output
300.

Which command is used to display the differences between files?

A. comm
B. diff
C. cmp
D. differ
Answer» C. cmp