Go Back   nV News Forums > Linux Support Forums > General Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 11-01-02, 10:14 AM   #1
FishTech
Registered User
 
Join Date: Oct 2002
Posts: 38
Default How do You delete a Directory and all it's contents?

Hi All!

How do You delete a Directory and all it's contents?

Thanks and Love You!
FishTech
__________________
BIBLICAL REVELATIONS
FishTech is offline   Reply With Quote
Old 11-01-02, 10:26 AM   #2
DaveW
Its me! Hurray!
 
DaveW's Avatar
 
Join Date: Jul 2002
Location: Brit in USA
Posts: 1,203
Default

rm -rf /somedirectory

be careful
__________________

Core2 Q9400 @ 3.0, eVGA GTX 260, 4G DDR 800, Vista64
DaveW is offline   Reply With Quote
Old 11-01-02, 11:59 AM   #3
FishTech
Registered User
 
Join Date: Oct 2002
Posts: 38
Default

Thanks DaveW,

I tried it but it didn't work?... I'm using Mandrake 9.0 if that makes a difference.

Also, as Root/Superuser don't I have the authority to delete any directory or file?... These directorys and files (that are now in the trash) that I'm trying to delete even as Root tell me acess denied... What's up with that?
__________________
BIBLICAL REVELATIONS
FishTech is offline   Reply With Quote
Old 11-01-02, 12:03 PM   #4
DaveW
Its me! Hurray!
 
DaveW's Avatar
 
Join Date: Jul 2002
Location: Brit in USA
Posts: 1,203
Default

Dunno... rm -rf is pretty much the only Linux command I know

Can anyone else help out here?
__________________

Core2 Q9400 @ 3.0, eVGA GTX 260, 4G DDR 800, Vista64
DaveW is offline   Reply With Quote
Old 11-01-02, 02:28 PM   #5
de><ta
prodigy
 
de><ta's Avatar
 
Join Date: Jul 2002
Location: USA, NY
Posts: 1,100
Default

rmdir directory/* to get rid of all files and dir

rmdir -rf directory
or try
rmdir -rf directory/*
NOTE:i dont use this to often, it can be risky especially at cmd line level


unix and linux commands are all universal. So if u know unix cmd line scripting u can use that for linux cmd scripting too.

By the way out of curiousity what directory are u nuking?


cheers
dexta
__________________
IBM T60p | Intel Core 2 Duo T7200 | 2GB PC2-5300 | ATi M X1700 256MB | 100GB 7200rpm SATA

///m-powered | Intel i7 920 | EVGA x58 | 6GB DD3 1600 | EVGA GTX 285 SSC | 150GB VelociRaptor

Drag racing is for fast cars. Autocrossing is for fast drivers.

Last edited by de><ta; 11-01-02 at 02:31 PM.
de><ta is offline   Reply With Quote
Old 11-01-02, 03:32 PM   #6
Klaus-P
Registered User
 
Join Date: Aug 2002
Location: Germany
Posts: 134
Default

" Hi All!
How do You delete a Directory and all it's contents?
Thanks and Love You!"

The "BIBLICAL REVELATION(S)" will LOVE you too while deleting a Directory, i'm almost sure.

(i hope my non-technical remark does not violate any thread 'laws', hmmmm.)
Klaus-P is offline   Reply With Quote
Old 11-01-02, 03:32 PM   #7
FishTech
Registered User
 
Join Date: Oct 2002
Posts: 38
Default

Hi de><ta, and thanks DaveW,

I tried them all and nothing worked... Am I doing something wrong?... Here's my shell session:

[peacemaker@localhost Trash]$ su
Password:
[root@localhost Trash]# rmdir -rf Kvidtune/*
rmdir: invalid option -- r
Try `rmdir --help' for more information.
[root@localhost Trash]# rmdir -rf Kvidtune
rmdir: invalid option -- r
Try `rmdir --help' for more information.
[root@localhost Trash]# rmdir Kvidtune/*
rmdir: `Kvidtune/kvidtune-0.4.1': Directory not empty
[root@localhost Trash]#
__________________
BIBLICAL REVELATIONS
FishTech is offline   Reply With Quote
Old 11-02-02, 09:25 AM   #8
mtrr
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 234
Send a message via ICQ to mtrr
Default

what about 'rm -rf Kvidtune' ?
that will work, the 'r' is for recursively and the 'f'
means force, without 'f' rm can't delete a directory.

cheers
mtrr is offline   Reply With Quote

Old 11-02-02, 09:56 AM   #9
synonymy
Guest
 
Posts: n/a
Default

rm -r nameofdirectory

works for me mdk9.0
  Reply With Quote
Old 11-02-02, 10:10 AM   #10
mtrr
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 234
Send a message via ICQ to mtrr
Default

synonymy: you're right, should have done some proof reading

the 'f' flag is needed incase there is a read-only file, as 'rm' would
choke on it and ask if you were really sure.....


cheers
mtrr is offline   Reply With Quote
Old 11-04-02, 03:28 PM   #11
FishTech
Registered User
 
Join Date: Oct 2002
Posts: 38
Default

Thanks Everyone,

'rm -r' worked... I did however have to answer 'y' for each and every file that I wanted to delete within the directory... Would there be an easier way?
__________________
BIBLICAL REVELATIONS
FishTech is offline   Reply With Quote
Old 11-04-02, 04:02 PM   #12
mtrr
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 234
Send a message via ICQ to mtrr
Default

'rm -rf' as I wrote and explained one post above.

or do 'unalias rm', then rm -f will do also
I assume it's either RH or MDK? am I right?


cheers


redhat (dunno MDK) set 'rm' to 'rm -i' (I know
not exactly, it's just an alias, but we may keep
that up for further axplanations later on, may we?)
mtrr is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:00 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.