Explore topic-wise MCQs in Unix.

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

1.

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

If the destination file does not exists, then mv command creates it.

A. True
B. False
Answer» B. False
3.

Which command is used for renaming files?

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

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

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

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

If the destination file does not exists, then mv command creates it.$

A. True
B. False
Answer» B. False
8.

Which_command_is_used_for_renaming_files?$

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

-f option when used with mv command overwrites existing files without prompting any messages.

A. True
B. False
Answer» B. False
10.

Which option is used with mv command so that the destination file does not get overwritten?

A. -n
B. -f
C. -b
D. -i
Answer» B. -f
11.

Which option is used for backing up destination file in mv command?

A. -b
B. -f
C. -v
D. -i
Answer» B. -f
12.

The inode number associated with a file is changed after renaming it.

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

Apart from renaming files, mv command can also

A. move a file
B. move a group of files
C. rename a directory
D. move a group of files and rename a directory
Answer» E.
14.

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

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

Which one of the following command can delete a directory which is not empty?

A. rm -r
B. rmdir
C. rm *
D. del *
Answer» B. rmdir
17.

Which option performs recursive deletion?

A. -r
B. -R
C. *
D. -r and -R
Answer» E.
18.

Which option is used with rm command for interactive deletion?

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

Some files cannot be deleted using rm command because of the permissions associated with it.

A. True
B. False
Answer» B. False
20.

To delete all files in a directory we use ______________

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

We can delete multiple files using a single rm command.

A. True
B. False
Answer» B. False
22.

Which command is used for removing/deleting files in UNIX?

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