delete folder in linux

Posted on 2006-04-03
Medium Priority
Last Modified: 2010-08-05
what is the command to delete folder that have many file inside inlinux with out confirmation to delete each file
Question by:teera
LVL 97

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 400 total points
ID: 16367752
Should be:

rm -f /path/to/folder

Be careful - the easiest way to screw up your system is to use rm -f /

LVL 24

Accepted Solution

fridom earned 400 total points
ID: 16367861
rm -f is not sufficient you have to use
rm -rf path/to/dir

LVL 97

Expert Comment

by:Lee W, MVP
ID: 16367885
-f = force delete - no prompting
-r = recursive - I forgot to do that in my example; the link I provided explains this in detail though.

And for reference, you can always type

man rm

on a command line to get the manual pages for rm.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Assisted Solution

ram_einstein earned 200 total points
ID: 16367965
rm -rf <foldername>

man rm for more.
LVL 14

Assisted Solution

kenfcamp earned 200 total points
ID: 16377637
you dont need the 'f'

rm -R /some/folder/location will work just fine
LVL 14

Expert Comment

ID: 16377647
eugh, then again if I had read the question, I wouldnt' have made the statement about not needing 'f'

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question