How to delete a directory containing files and folders?

Answers were Sorted based on User's Feedback



How to delete a directory containing files and folders?..

Answer / wizard_cmp@yahoo.co.in

rm -r <dir_name>

Is This Answer Correct ?    9 Yes 1 No

How to delete a directory containing files and folders?..

Answer / subbareddy kake

rm <file name>: For deleting the file

rm -i:It will ask conformation

rmdir:For removing the directory

rm -r:It remove recursively all files and directory itself

rm -rf: for deleting the all files and subdirectories in
current directory

Is This Answer Correct ?    7 Yes 0 No

How to delete a directory containing files and folders?..

Answer / padmanaban

"find -type d -iname 'directoryname' | xargs rm -rf" this is
also a way to remove the folder and files.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More Unix Commands Interview Questions

what is virtual machine?

2 Answers   Infosys,


A file has 1000 lines and i want to display only 1st line how to do it? pls ..tel me

7 Answers   CTS,


How can you see the command line history?

0 Answers  


What are the commands in UNIX to list the files in a Directory?

0 Answers   CGI,


What is the difference between awk and grep?

0 Answers  


Write a command to kill the last background job?

0 Answers  


What are the differences among a system call, a library function, and a unix command?

0 Answers  


What is awk command used for?

0 Answers  


What is nr in awk command?

0 Answers  


How do I run a bash script?

0 Answers  


In UNIX, what is the command to kill a process?

10 Answers  


How do you change your account's password?

6 Answers  


Categories