Operating System - HP-UX
1753987 Members
4954 Online
108811 Solutions
New Discussion юеВ

Re: How do I remove a directory and all of its files?

 
SOLVED
Go to solution
Jeff Thomas_1
Contributor

How do I remove a directory and all of its files?

I have a directory which contains files that I wish to delete. How do I go through this. I know the rmdir command will allow me to remove the directory, but it won't let me do it with all the files and subdirectories in it.
Thanks so much for helping a newbie!
2 REPLIES 2
alberto vasquez
Trusted Contributor
Solution

Re: How do I remove a directory and all of its files?

Try rm.

# rm -R /directory
Rob Smith
Respected Contributor

Re: How do I remove a directory and all of its files?

Hi, the command is rm -R but be very careful that you are deleting what you really want to delete. You can use the -f option to not be prompted for every deletion. Hope this helps.

Rob

Learn the rules so you can break them properly.