Results 1 to 4 of 4
the rm command man pages discusses removing files or directories recursively.
So what is meant by deleting a file or directory recursively? and what are some reasons for doing so?...
- 01-29-2010 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 4
remove recursively
the rm command man pages discusses removing files or directories recursively.
So what is meant by deleting a file or directory recursively? and what are some reasons for doing so?
- 01-29-2010 #2
It means removing a directory, and everything in it.
- 02-01-2010 #3Just Joined!
- Join Date
- Feb 2010
- Posts
- 16
If you want to delete a directory/folder, you have to use -r. If the directory is empty, you can also use rmdir
- 02-01-2010 #4Just Joined!
- Join Date
- Nov 2007
- Location
- Salt Lake City, UT, USA
- Posts
- 32
As a general rule, anytime I am using rm -r, I will specify the entire path of the folder I wanted deleted recursively.
For instance, if I want to delete the contents of directory lame-program from /opt/software/lame-program, I'll do
instead ofCode:/opt/software/lame-program# rm -r /opt/software/lame-program/*
Once, during a down-time window at work in the middle of the night, I meant to run the command as shown in the 2nd example, but forgot a pretty important part:Code:/opt/software/lame-program# rm -r ./*
. The missing dot means your root partition is going to get deleted recursively. It isn't a fun place to be in. After that experience, I always go non-lazy when rm -r is involved.Code:/opt/software/lame-program# rm -r /*


Reply With Quote