removing content of directory
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
removing content of directory
How can I delete the entire content of a directory with a single command? I want the equivalent of del foldername*.* I started rm'ing the files individualy but it's just too long. For some reason a bunch of mail got stuck in the mail queue and it keeps bouncing all over the server and not going anywhere and it's muliplying each time. It's at like 300+ now so I just want to delete them. webmin only allows me to delete 20 at once which is stupid, so that takes long too.
Archived topic from Anythingforums, old topic ID:614, old post ID:5382
Archived topic from Anythingforums, old topic ID:614, old post ID:5382
Honk if you love Jesus, text if you want to meet Him!
removing content of directory
rm -rf *
make sure your in the directory that you want this to happen. You can use rm -rf /home/red/ohnooos!
but i've have bad mistakes with that deleting things that can't come back. The "rm" tool doesn't have a recycle bin
Archived topic from Anythingforums, old topic ID:614, old post ID:5405
make sure your in the directory that you want this to happen. You can use rm -rf /home/red/ohnooos!
but i've have bad mistakes with that deleting things that can't come back. The "rm" tool doesn't have a recycle bin
Archived topic from Anythingforums, old topic ID:614, old post ID:5405
removing content of directory
neither does using del or deltree in windows.The "rm" tool doesn't have a recycle bin
Archived topic from Anythingforums, old topic ID:614, old post ID:5408
Resistance is futile...
Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums
"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
removing content of directory
I would think not as the recycle bin was not stolen from the Mac system GUI until win95 when windows finally just started to catch up on the visual side.megaspaz wrote:neither does using del or deltree in windows.The "rm" tool doesn't have a recycle bin
Archived topic from Anythingforums, old topic ID:614, old post ID:5409
Started talking to yourself I see.
Yes, it was the only way I could be sure of an intelligent conversation
Blackadder
Yes, it was the only way I could be sure of an intelligent conversation
Blackadder
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
removing content of directory
Thanks rm -f * worked
Well deleted stuff is recoverable, just not an easy task to do and you need a special program, which starts at a few grand and is hard to get at discount stores such as K-mart (Kazaa mart)
Archived topic from Anythingforums, old topic ID:614, old post ID:5420
Well deleted stuff is recoverable, just not an easy task to do and you need a special program, which starts at a few grand and is hard to get at discount stores such as K-mart (Kazaa mart)
Archived topic from Anythingforums, old topic ID:614, old post ID:5420
Honk if you love Jesus, text if you want to meet Him!
removing content of directory
rm -rf -- using the 'r' means recursive, and the 'f' means force, so it won't ask you if you want to delete the files.
Archived topic from Anythingforums, old topic ID:614, old post ID:5477
Archived topic from Anythingforums, old topic ID:614, old post ID:5477
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
removing content of directory
Yeah I knew that. That's why I never type rm -rf /
Archived topic from Anythingforums, old topic ID:614, old post ID:5487
Archived topic from Anythingforums, old topic ID:614, old post ID:5487
Honk if you love Jesus, text if you want to meet Him!
removing content of directory
rm -rf / can be pretty totally safe... if invoked as a regular user. the only things that i know of off a default install that would get deleted would be files and directories owned by the user in /tmp.
*disclaimer, try it at your own risk.
Archived topic from Anythingforums, old topic ID:614, old post ID:5662
*disclaimer, try it at your own risk.
Archived topic from Anythingforums, old topic ID:614, old post ID:5662
Resistance is futile...
Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums
"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
removing content of directory
unless you do a recursive chmod 777 on the / before.
Archived topic from Anythingforums, old topic ID:614, old post ID:5813
Archived topic from Anythingforums, old topic ID:614, old post ID:5813
Honk if you love Jesus, text if you want to meet Him!
removing content of directory
well then i guess you'd better stay away from chmod and rm.Red Squirrel wrote: unless you do a recursive chmod 777 on the / before.
Archived topic from Anythingforums, old topic ID:614, old post ID:5845
Resistance is futile...
Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums
"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
removing content of directory
Yep. But it would be near impossible to do both by accident though so that's reassuring.
So.... is the fact that I do everything under root bad? Since most things have it documented that it only works under root, so I never bothered making another account. So if I do rm -rf / will it delete everything? (including any mapped drives etc...)
Archived topic from Anythingforums, old topic ID:614, old post ID:5865
So.... is the fact that I do everything under root bad? Since most things have it documented that it only works under root, so I never bothered making another account. So if I do rm -rf / will it delete everything? (including any mapped drives etc...)
Archived topic from Anythingforums, old topic ID:614, old post ID:5865
Honk if you love Jesus, text if you want to meet Him!
-
- Posts: 35
- Joined: Thu Dec 18, 2003 8:40 am
removing content of directory
Red Squirrel wrote: So.... is the fact that I do everything under root bad? Since most things have it documented that it only works under root, so I never bothered making another account. So if I do rm -rf / will it delete everything? (including any mapped drives etc...)
By doing so you are bypassing one of the nicest security features of the linux kernel. It's your choice, but get into the bad habit now and you'll end up regretting it.
Andrew
Archived topic from Anythingforums, old topic ID:614, old post ID:9318
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
removing content of directory
But what's the other alternative?
Whenever I read something it says that it only works under root. Obviously I have my server programs running as their own user (ex: apache runs under "apache") but for installing stuff and all that, I go under root.
Archived topic from Anythingforums, old topic ID:614, old post ID:9534
Whenever I read something it says that it only works under root. Obviously I have my server programs running as their own user (ex: apache runs under "apache") but for installing stuff and all that, I go under root.
Archived topic from Anythingforums, old topic ID:614, old post ID:9534
Honk if you love Jesus, text if you want to meet Him!