LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-23-2013, 10:52 PM   #1
skippy1729
Member
 
Registered: Oct 2008
Posts: 91

Rep: Reputation: 0
deleting nonempty directories


Is there a way to delete a non-empty directory with subdirectories? I know I can send to trash in a GUI but would like to do it from the terminal interface.
 
Old 05-23-2013, 10:58 PM   #2
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,461

Rep: Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368Reputation: 1368
Use the rm command with -rf options
Code:
rm -rf <non-empty directory>
 
1 members found this post helpful.
Old 05-23-2013, 11:14 PM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by allend View Post
Use the rm command with -rf options
@skippy1729:
I think it's better to go through the manual of rm (see here), so you can use other command line options as well like -i for interactive remove i.e. it will ask you before deletion of the directory.
Code:
~$ rm -rfi /path/to/directory
Just take a note, that rm -rf is very dengerous command and it's wrong use may destroy your system in seconds, so invoke it with caution.
 
4 members found this post helpful.
  


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 directories sectore Linux From Scratch 1 04-10-2009 03:16 PM
Deleting directories NomadABC Linux - Newbie 2 02-10-2005 03:11 PM
rm command - deleting directories Micro420 Linux - Newbie 11 11-02-2003 03:18 PM
Deleting Directories J_Bone Linux - Newbie 4 08-17-2003 05:19 PM
deleting directories AZDAVE Linux - Newbie 1 08-15-2003 11:05 AM


All times are GMT -5. The time now is 10:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration