cannot remove* Is a directory

From: Gordon Holtslander <linux_at_no.spam.please>
Date: Wed Sep 10 2003 - 10:04:02 CST

A few year ago when I decided to switch distributions it did rm -rf * from /

The entire contents of the machine were deleted without so much as an "are you

rm -rf * is a weapon of mass destruction :) Use with caution.

-r recurse through the directory and delete all the files
-f f force - ignore non-existant files and don't prompt
* the wildcard for everything

rm -rf * - delete everything contained within this directory and don't prompt.

A more conservative approach is to use rmdir - it will delte an _empty_
directory. Its necessary to first delete all the files within the directory
to be deleted. (usually with an rm *)

If the directoy contains a series of nested directories this can become
tedious. Its then necessary to go into each directory delete all the files
it contains, then go to its parent directory and delete the empty directory.
This has to be done until there are no files or directories left - then the
empty directory can be deleted.

Its much easier to use the dangerous rm -rf * . If you use this you could use
the command: ls * , first . This will list all the files and directories
(and the files within these directories) in the current directory.

This will essentially give you a listing of all the files and directories that
will deleted with rm -rf * (Assuming both commands are given from the same
location in your file hierarchy)

  If you see something you don't want to delete then you _shouldn't_ issue rm
-rf *


On September 10, 2003 9:24 am, Scott Wunsch wrote:
> On Wed, 10-Sep-2003 at 07:10:49 -0700, Graham Bendell wrote:
> > i always use rm-rf dirname
> >
> > it wont ask you for confirmation, and it will delete the dir, and sub
> > dirs there in and files without a second thought.
> And if you're not careful, it'll remove your foot too ;-).

Gordon J. Holtslander	/	Department of Biology /	University of Saskatchewan
Tel 306 966-4433	/	112 Science Place
Fax 306 966-4461	/	Saskatoon SK S7N 5E2
Received on Wed Sep 10 10:04:02 2003

This archive was generated by hypermail 2.1.8 : Mon Mar 06 2006 - 18:35:12 CST