LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 04-17-2002, 07:06 PM   #1
psyklops
Member
 
Registered: Jan 2002
Location: Los Angeles
Distribution: RedHat 9.0
Posts: 216

Rep: Reputation: 30
Cmd to rm dir thats has files and other dirs


Whats the command to force the removal of a directory that has files and other dirs inside of it. I hate having to go through piece by piece....
 
Old 04-17-2002, 07:15 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,345

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
try "man rm" or even "rm --help"
 
Old 04-17-2002, 07:55 PM   #3
psyklops
Member
 
Registered: Jan 2002
Location: Los Angeles
Distribution: RedHat 9.0
Posts: 216

Original Poster
Rep: Reputation: 30
OPTIONS
Remove (unlink) the FILE(s).

-d, --directory
unlink directory, even if non-empty (super-user only)

-f, --force
ignore nonexistent files, never prompt



Ive tried both of thes and get

rm: cannot unlink `john-1.6': Is a directory
 
Old 04-17-2002, 08:00 PM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 194Reputation: 194
try rm -rf name-of-dir that should remove the directory and force it... i think you can also do a rmdir.. man for options
 
Old 04-17-2002, 08:12 PM   #5
psyklops
Member
 
Registered: Jan 2002
Location: Los Angeles
Distribution: RedHat 9.0
Posts: 216

Original Poster
Rep: Reputation: 30
Thanks. It the option -r that did it for me. I checked the man page and it says that this option removes everything recursively. I dont really understand how this would work unless it would start at the bottom of the directory and work its way up removing the files within a dir, leaving it empty, to be removed from with the dir it was subsiding in... I dont even know if that makes sense.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script to process every file in current dir and sub dirs BuckRogers01 Linux - Software 3 09-06-2005 07:32 AM
chkrootkit - suspicious files and dirs Dave Lerner Linux - Security 2 07-09-2005 08:49 AM
Need cmd to know if the necessary dir/file exists kornerr Linux - General 2 02-07-2005 09:49 AM
invisible files and dirs karmine Slackware - Installation 8 12-26-2004 03:05 PM
ls, dirs first, files later TroelsSmit Linux - Newbie 4 05-31-2004 11:47 AM


All times are GMT -5. The time now is 02:03 PM.

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 Google+: linuxquestions
Open Source Consulting | Domain Registration