How to remove files and directories quickly via terminal (bash shell)

None picture None · Apr 15, 2010 · Viewed 536.5k times · Source

From terminal window:

When I use the rm command it can only remove files.
When I use the rmdir command it only removes empty folders.

If I have a directory nested with files and folders within folders with files and so on, is there any way to delete all the files and folders without all the strenuous command typing?

If it makes a difference, I am using the mac bash shell from terminal, not Microsoft DOS or linux.

Answer

Jim Lewis picture Jim Lewis · Apr 15, 2010
rm -rf some_dir

-r "recursive" -f "force" (suppress confirmation messages)

Be careful!