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 05-23-2013, 09:52 PM   #1
skippy1729
Member
 
Registered: Oct 2008
Posts: 95

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, 09:58 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,374

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
Use the rm command with -rf options
Code:
rm -rf <non-empty directory>
 
1 members found this post helpful.
Old 05-23-2013, 10: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



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

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

All times are GMT -5. The time now is 03:49 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