LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 11-07-2006, 05:15 PM   #1
rossi46
Member
 
Registered: Jan 2006
Location: Scotland
Distribution: PCLinuxOS 2007 + Zenwalk 4.8
Posts: 41

Rep: Reputation: 15
Deleting files


Hi all

I have some folders which I'd like to remove, but when I use the rmdir command, I get a message telling me that the directories are not empty. I've already deleted one directory that only had 5 files in it, but the one I want to delete now has more than 30 in it.

Do I have to delete them one at a time or is there a command for multiple deleting, please?

thanks as ever

Paul
 
Old 11-07-2006, 05:20 PM   #2
OldAl
Member
 
Registered: Oct 2006
Location: Canberra, Australia
Distribution: Kubuntu "Feisty",openSUSE10.3
Posts: 93

Rep: Reputation: 15
Delete all files recursively and the directory will disappear, too :-)

rm -R <your non-empty directory>

HTH a little,

OldAl.
 
Old 11-07-2006, 05:20 PM   #3
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 60
You can use the following command:

rm -fr <dir_name>

Be carefull with this as it will remove all file's and sub-directories under <dir_name>. So make sure they all need to go before pulling the trigger.
 
Old 11-07-2006, 05:42 PM   #4
rossi46
Member
 
Registered: Jan 2006
Location: Scotland
Distribution: PCLinuxOS 2007 + Zenwalk 4.8
Posts: 41

Original Poster
Rep: Reputation: 15
Wow, thanks, guys

Pauly
 
Old 11-08-2006, 02:25 AM   #5
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,601

Rep: Reputation: 45
Quote:
rm -fr <dir_name>
a note of caution
rm -fr /home/someuser/somedir is fine

I believe
rm -fr / home/someuser/somedir with a space typo
and you loose everything
(never tried!)
 
Old 11-08-2006, 08:15 AM   #6
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 60
Very good point Emmanuel_uk. Definitely watch what you hit when swinging the big hammer, especially if you are root.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting old files shiroh_1982 Linux - Newbie 2 06-21-2006 07:26 AM
Deleting files in C monil Programming 4 03-13-2005 10:33 AM
Deleting files! a_priebe47 Slackware 6 10-17-2004 09:58 PM
Deleting files ShakyJake Linux - Newbie 12 05-08-2003 03:07 PM
Deleting files Tingle Linux - Newbie 4 01-16-2003 04:19 PM


All times are GMT -5. The time now is 04:26 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration