The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
searching files inside directory kylethesir UNIX for Dummies Questions & Answers 4 06-06-2008 01:44 AM
How to see directory and the files inside it. shaan_dmp UNIX for Advanced & Expert Users 4 12-17-2007 05:48 AM
unix command/s to find files older than 2 hours in a directory Presanna Shell Programming and Scripting 6 11-20-2007 09:22 AM
awk command to find the count of files ina directory sish78 Shell Programming and Scripting 11 07-19-2007 08:00 AM
Help Using Grep command to Find the string in the files in the root directory Subbu_Angeline AIX 3 01-17-2007 01:45 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-10-2007
bmkreddy bmkreddy is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 8
How to delete Directory and inside files using Find command

I am using the following Command to delete Directory with contents. But this command is deleting inside files only not directories. is there any change need in my command?

find -type f -mtime +3 -exec rm -r {} \;


Thanks
  #2 (permalink)  
Old 07-10-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
To delete the directory itself and all of the files and sub-directories:
Code:
rm -f -R  directoryname
  #3 (permalink)  
Old 07-10-2007
bmkreddy bmkreddy is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 8
I got solution for this one i need to change my command like this
  #4 (permalink)  
Old 07-10-2007
bmkreddy bmkreddy is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 8
I got solution for this one i need to change my command like this

find -type d -mtime +3 -exec rm -r {} \;


Or

find -mtime +3 -exec rm -r {} \;


Thanks
Sponsored Links
Closed Thread

Bookmarks

Tags
delete directory

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0