MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

UNIX

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which command is used to remove a directory?
A
rd
B
rmdir
C
dldir
D
rdir
Explanation: 

Detailed explanation-1: -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-2: -The rmdir command removes each and every directory specified in the command line only if these directories are empty. So if the specified directory has some directories or files in it then this cannot be removed by rmdir command.

Detailed explanation-3: -Deletes a directory tree (the specified directory and all its subdirectories, including all files).

Detailed explanation-4: -Which command is used for removing an empty directory? Explanation: rmdir command is used for removing directories provided the directory should be empty.

Detailed explanation-5: -How to Remove a Directory in Linux. To permanently remove a directory in Linux, use either the rmdir or rm command: Use the rmdir or rm-d command to remove empty directories. Use the rm-r command to remove non-empty directories.

There is 1 question to complete.