Explore topic-wise MCQs in Unix.

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

1.

ls -s prints the allocated file size in blocks.

A. True
B. False
Answer» B. False
2.

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
3.

-r option is same as -R option in ls command.

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

$ ls -R outputs all files and subdirectories in a recursive manner.

A. True
B. False
Answer» B. False
5.

-R_OPTION_IS_SAME_AS_-R_OPTION_IN_LS_COMMAND.?$

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

ls -s prints the allocated file size in blocks.$

A. True
B. False
Answer» B. False
7.

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
8.

The output of ls dir* is ___

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

-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
10.

-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
11.

ls -R outputs all files and subdirectories in a recursive manner?

A. True
B. False
Answer» B. False
12.

How can we identify executables and directories from the output of ls command?

A. using -F option
B. using -x option
C. using -a option
D. using -i option
Answer» B. using -x option
13.

What is the collating sequence of ls command for listing files?

A. Numerals > Uppercase > Lowercase
B. Numerals > Lowercase > Uppercase
C. Lowercase > Uppercase > Numerals
D. Uppercase > Numerals > Lowercase
Answer» B. Numerals > Lowercase > Uppercase
14.

Which option is used with ls command to produce multi columnar output?

A. -x
B. -F
C. -a
D. -v
Answer» B. -F
15.

-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
16.

Which option is used with ls to display attributes of the directory ?

A. -a
B. -ld
C. -d
D. -o
Answer» D. -o
17.

Which option is used with ls command for long listing of files with seven attributes?

A. -a
B. -l
C. -x
D. -i
Answer» C. -x
18.

Which command is used for listing files in a directory?

A. ps
B. list
C. ls
D. wc
Answer» D. wc