MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

UNIX

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which command is/are used to remove directory in Linux?
A
rmdir
B
rm-r
C
only b
D
Both a and b
Explanation: 

Detailed explanation-1: -You use the rm command to delete files and directories in Linux. For directories, this command can be used to delete a directory entirely – that is, it deletes a directory and all files and subdirectories within the directory.

Detailed explanation-2: -Use the rmdir command to remove the directory, specified by the Directory parameter, from the system. The directory must be empty (it can contain only . and ..) before you can remove it, and you must have write permission in its parent directory.

Detailed explanation-3: -The rm command deletes files in a Linux. The command unlinks the data from the file name, allowing the user to overwrite on that particular storage space. Wildcards can be used with this command. This will erase any file that has the word sample in the name.

Detailed explanation-4: -There are two Linux commands you can use to remove a directory from the terminal window or command line: The rm command removes complete directories, including subdirectories and files. The rmdir command removes empty directories.

Detailed explanation-5: -Explanation: rmdir command is used for removing directories provided the directory should be empty.

There is 1 question to complete.