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.

301.

What if the destination file specified in mv command already exists ?

A. it will be deleted
B. it will not be affected
C. it will be overwritten
D. an error will be produced
Answer» D. an error will be produced
302.

Which command is used for renaming files?

A. rename
B. mv
C. cp
D. move
Answer» C. cp
303.

Which command is used for removing file named -file.txt?

A. rm –file.txt
B. rm file.txtrm
C. rm — -file.txt
D. rm –f file.txt
Answer» D. rm –f file.txt
304.

If we wish to delete a remove a file forcefully, we can use ____ option with rm command.

A. -i
B. -r
C. -R
D. -f
Answer» E.
305.

To delete all files in a directory we use _______

A. rmdir *
B. mv *
C. rm *
D. del *
Answer» D. del *
306.

–v option is used with cp command for displaying __

A. errors
B. informative messages
C. diagnostic messages
D. file contents
Answer» C. diagnostic messages
307.

–n option is used with cp command for what purpose?

A. existing file should not be overwritten
B. to update file
C. interactive copying
D. recursive copying
Answer» B. to update file
308.

What does -i option do?

A. interactive copying
B. recursively copying
C. updating
D. none of the mentioned
Answer» B. recursively copying
309.

What is the correct syntax for copying multiple files with a filename starting as ‘file’ into another file named as ‘directory_one’?

A. cp -i file directory_one
B. cp -R file directory/directory_one
C. cp file* directory_one
D. none of the mentioned
Answer» D. none of the mentioned
310.

Which one of the following commands is incorrect?

A. cat file01
B. cat > file01
C. cat >> file1
D. cat -a file01
Answer» E.
311.

What does cat file01 file01 file01 display?

A. error
B. blank terminal
C. contents of file01 three times successively
D. contents of file01 single time
Answer» D. contents of file01 single time
312.

Which of the following cannot be performed by cat command?

A. displaying files
B. creating files
C. appending files
D. deleting files
Answer» E.
313.

–t option sorts the files according to __

A. last modification time
B. last access time
C. ASCII collating sequence
D. file size
Answer» B. last access time
314.

The output of ls dir* is __

A. all files in the current directory
B. all files in the directory having filename starting with dir
C. no filename is displayed
D. erroneous
Answer» C. no filename is displayed
315.

–u option sorts the files according to __

A. last modification time
B. last access time
C. ASCII collating sequence
D. file size
Answer» C. ASCII collating sequence
316.

What does the –S option do in ls command?

A. sorts according to modification time
B. sorts according to last access time
C. sorts according to file size
D. sorts according to inode number
Answer» D. sorts according to inode number
317.

–a option is used with ls command for what purpose?

A. for showing hidden files
B. for showing executables
C. for showing directories
D. for multi columnar output
Answer» B. for showing executables
318.

For moving two level up in the file hierarchy system using cd command once, we separates ( . . ) by which symbol?

A. ?
B. $
C. *
D. /
Answer» E.
319.

$ cp file_01 . copies the file named file_01 in ____ directory

A. current
B. parent
C. root
D. user
Answer» B. parent
320.

$ cd . . is used to move ___ level up in the file hierarchy.

A. two
B. one
C. three
D. zero
Answer» C. three
321.

Which command is used for removing an empty directory?

A. mkdir
B. rmdir
C. del
D. remove
Answer» C. del
322.

Sometimes we are unable to create a directory because __________

A. the directory may already exist in the current directory
B. there may be a ordinary file by the same name innthe current directory
C. the permissions set for the current directory does not allow the creation
D. the directory may exist, there may be a ordinary file, the permissions set for the current directory does not allow the creation
Answer» E.
323.

Which command is used for printing the current working directory ?

A. HOME
B. cd
C. pwd
D. dir
Answer» D. dir
324.

The root directory is represented by _

A. /
B. \
C. *
D. $
Answer» B. \
325.

When we log in, the UNIX places us in a directory, called ______ directory

A. home
B. main
C. parent
D. current
Answer» B. main
326.

Each entry of directory file has component(s) namely __

A. filename
B. inode number
C. filename and inode number
D. file size
Answer» D. file size
327.

The most common file type is _

A. ordinary file
B. directory file
C. device file
D. ordinary file and directory file
Answer» B. directory file
328.

In how many broad categories, files are divided in UNIX?

A. 2
B. 4
C. 5
D. 3
Answer» E.
329.

Which command is used for killing a line?

A. ctrl-k
B. del
C. esc
D. ctrl-u
Answer» E.
330.

Ctrl-S stops scrolling of screen output and ____

A. locks terminal
B. delete a character
C. locks keyboard
D. delete a line
Answer» D. delete a line
331.

Which control unlocks the keyboard?

A. ctrl-u
B. ctrl-c
C. ctrl-z
D. ctrl-q
Answer» E.
332.

For interrupting a command, we can use __

A. ctrl-f
B. esc
C. ctrl-h
D. ctrl-c
Answer» E.
333.

Which command handles a character stream by duplicating its input?

A. tree
B. tee
C. tty
D. ls
Answer» C. tty
334.

When backspace doesn’t work to erase characters, we can use ___

A. ctrl-f
B. ctrl-h
C. ctrl-c
D. ctrl-u
Answer» C. ctrl-c
335.

–h option is used with who command for what purpose?

A. display output with header information.
B. display output with a more detailed version
C. display output with trailer information
D. display output in columnar form
Answer» B. display output with a more detailed version
336.

Which command is used by the user to change their login password in UNIX?

A. man
B. reset
C. passwd
D. cp
Answer» D. cp
337.

Which of the following is not an internal command used by mailx?

A. N
B. d
C. q
D. a
Answer» E.
338.

Which of the following function cannot be performed by mailx command?

A. sending and receiving mails
B. reply to the sender
C. forward, delete and print mails
D. un-send mails
Answer» E.
339.

script command is used for___

A. recording history
B. recording our session
C. recording passwords
D. recording scripts
Answer» C. recording passwords
340.

echo command is used for ___

A. displaying errors
B. displaying operating system details
C. displaying diagnostic messages
D. displaying date and time
Answer» D. displaying date and time
341.

Which command is used for displaying date in the format dd/mm/yyyy ?

A. date +%m
B. date +%h
C. date +“%d/%m/%Y”
D. date +“%h %m”
Answer» E.
342.

What are meta-characters?

A. special characters having predefined meaning to the shell
B. special symbols
C. shell symbols
D. command symbols
Answer» B. special symbols
343.

What is the output of who command?

A. display information about users who are currently logged in.
B. display file hierarchy
C. display administrator information
D. display processes
Answer» B. display file hierarchy
344.

Which command is used for displaying date and calendar in UNIX?

A. date and cal
B. DATE and CAL
C. date and calendar
D. dt and cl
Answer» B. DATE and CAL
345.

What are Commands?

A. specific instructions for performing a particular task
B. part of the operating system
C. part of the shell
D. special instructions
Answer» B. part of the operating system
346.

What is the windowing system of UNIX known as?

A. X Window system
B. LINUX
C. Red Hat
D. DOS
Answer» B. LINUX
347.

What is a superuser?

A. system manager
B. normal user
C. administrator
D. a user with special rights
Answer» B. normal user
348.

TWO_UNIX_SYSTEMS_MAY_OR_MAY_NOT_USE_THE_SAME_SET_OF_SYSTEM_CALLS.?$

A. True
B. False
Answer» C.
349.

What is the windowing system of UNIX known as?$

A. X Window system
B. LINUX
C. Red Hat
D. DOS
Answer» B. LINUX
350.

What is a superuser?$

A. system manager
B. normal user
C. administrator
D. a user with special rights
Answer» B. normal user