LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-22-2007, 05:31 AM   #1
runnerpaul
Member
 
Registered: Mar 2006
Location: Ireland
Distribution: Fedora 5
Posts: 66

Rep: Reputation: 15
What is the command for deleting a directory?


What is the command for deleting a directory?
 
Old 03-22-2007, 05:45 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,959

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Start with "man rmdir" - in need proceed to "man rm".
 
Old 03-22-2007, 06:22 AM   #3
binary_0011
Member
 
Registered: Apr 2006
Location: Singapore
Distribution: RHEL4,FC4,FC5
Posts: 89

Rep: Reputation: 15
Quote:
Originally Posted by runnerpaul
What is the command for deleting a directory?


rm -r directoryname --force
 
Old 03-22-2007, 06:55 AM   #4
jerril
Member
 
Registered: Nov 2005
Location: Ontario, Canada
Distribution: Ubuntu
Posts: 114

Rep: Reputation: 15
Similar to binary_0011, but easier to type:

rm -rf directoryname

jer
 
Old 03-22-2007, 08:18 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
rm -rf will remove a directory and its contents without prompting you to be sure that's what you want.

rmdir removes only an empty directory---much safer: clean out the directory, then remove it
 
Old 03-22-2007, 09:20 AM   #6
mukund_chavan
LQ Newbie
 
Registered: Mar 2007
Posts: 3

Rep: Reputation: 0
deleting directory

Quote:
Originally Posted by runnerpaul
What is the command for deleting a directory?
root# rmdir dir_name --> if directory is empty
root# rm -fr dir_name
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a directory esm03 Linux - Newbie 2 06-28-2006 12:15 PM
deleting directory w/o descending STAGED Linux - Newbie 5 08-24-2005 09:39 AM
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 07:05 AM
Deleting a directory... closet geek Linux - General 7 07-09-2003 07:25 AM
deleting non-empty directory sadiboyz Linux - Newbie 2 04-21-2003 10:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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