How do I remove a folder and all its contents including files and other folders?
You need to use the rm command. Use the -r option to remove the listed directories and their contents recursively. The syntax is:
rm -rf dirName
In this example, remove data directory and their contents recursively, enter:
rm -rf data
See also:
See the rm command man page for more information:
man rm
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 1 comment… read it below or add one }
Typos here:
“m” instead of “rm” ! ;-)