LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 04:31 AM   #1
runnerpaul
Member
 
Registered: Mar 2006
Location: Ireland
Distribution: Fedora 5
Posts: 67

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


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

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Start with "man rmdir" - in need proceed to "man rm".
 
Old 03-22-2007, 05: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, 05:55 AM   #4
jerril
Member
 
Registered: Nov 2005
Location: Ontario, Canada
Distribution: Linux Mint
Posts: 116

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

rm -rf directoryname

jer
 
Old 03-22-2007, 07:18 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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, 08: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



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 11:15 AM
deleting directory w/o descending STAGED Linux - Newbie 5 08-24-2005 08:39 AM
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 06:05 AM
Deleting a directory... closet geek Linux - General 7 07-09-2003 06:25 AM
deleting non-empty directory sadiboyz Linux - Newbie 2 04-21-2003 09:29 PM

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

All times are GMT -5. The time now is 03:41 AM.

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
Open Source Consulting | Domain Registration