What Command will remove a Directory in UNIX?

Answers were Sorted based on User's Feedback



What Command will remove a Directory in UNIX?..

Answer / ziauddin

rmdir directoryname

note the directory must be empty

Is This Answer Correct ?    27 Yes 3 No

What Command will remove a Directory in UNIX?..

Answer / sambasivarao

This has two options

1) If directory is an empty directory
$rmdir <directory name>

2) If it is non-empty directory
$rm -rf <directory name>

-r means delete recursively
-f means delete forcibly.

It deletes your mentioned directory without informing
you that it is going to delete the whole directory (sub
directories and files in that directory)

J. Sambasivarao
91+ 9948280248

Is This Answer Correct ?    24 Yes 0 No

What Command will remove a Directory in UNIX?..

Answer / brajesh kumar

for removing directory
rm -rf *
for all dir

Is This Answer Correct ?    19 Yes 3 No

What Command will remove a Directory in UNIX?..

Answer / swathi

$rm -r dir1
-r removes all contents of dir1 and also dir1 itself.

Is This Answer Correct ?    16 Yes 1 No

What Command will remove a Directory in UNIX?..

Answer / khemnath chauhan

$rmdir <dirname>
will remove the diretory.
$rmdir -i <dirname>
will remove interactively

Is This Answer Correct ?    12 Yes 0 No

What Command will remove a Directory in UNIX?..

Answer / brijmohan

rmdir is used.

we can also use rm -rf to remove directory recursively.
means it will first remove all files and folder from that
directory then it will remove current folder.

Is This Answer Correct ?    0 Yes 0 No

What Command will remove a Directory in UNIX?..

Answer / yuvaevergreen

rm -r

Is This Answer Correct ?    0 Yes 0 No

What Command will remove a Directory in UNIX?..

Answer / suryakanta

rm-rf directoryname
this will remove the directory forcefully from unix.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix Commands Interview Questions

How do I run a whois command?

0 Answers  


what is the use of "grep" command?

6 Answers   HCL,


Is grep faster than awk?

0 Answers  


What command is used to check the current users?

0 Answers  


Explain command to view process running?

0 Answers  






What is awk good for?

0 Answers  


What does this command do? Cat food 1 > kitty

0 Answers  


what is mount ,tell me about mount ,how can u use in real time project??

12 Answers   Symphony,


How do I use grep to search for a file?

0 Answers  


Which command will print your home directory on screen?

0 Answers  


how to find largest file?

14 Answers   HCL, Microsoft, Thomson Reuters,


What command would users use to see what file one page at a time in UNIX?

7 Answers   IBM,


Categories