The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to get the timestamp of files from the files and folders in Unix kishan HP-UX 2 04-09-2008 05:20 AM
Looking for Large Files and Folders bbbngowc Shell Programming and Scripting 8 04-02-2008 10:09 AM
list only files or folders jagnikam Shell Programming and Scripting 6 01-18-2008 07:59 AM
delete all folders/files and keep only the last 10 in a folder melanie_pfefer Shell Programming and Scripting 3 11-17-2006 12:33 PM
How to Differentiate Between Files and Folders? dgower2 UNIX for Dummies Questions & Answers 6 04-28-2006 09:10 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-29-2007
Registered User
 

Join Date: Sep 2007
Posts: 3
removing old files except configuration files and folders

Dear all,
I want to remove files older than 2 months in the /home/member directory. But except the configuration files (like .bash_profile .config/ .openoffice/ .local/ .kde/ etc..)

I have tried with the command
find . -mtime +60 -wholename './.*' -prune -o -print -exec mv {} \;
but it deletes newer files also.


thanks
Reply With Quote
Forum Sponsor
  #2  
Old 11-09-2007
Registered User
 

Join Date: Oct 2007
Posts: 5
Quote:
Originally Posted by jamcalicut View Post
Dear all,
I want to remove files older than 2 months in the /home/member directory. But except the configuration files (like .bash_profile .config/ .openoffice/ .local/ .kde/ etc..)

I have tried with the command
find . -mtime +60 -wholename './.*' -prune -o -print -exec mv {} \;
but it deletes newer files also.


thanks
find /home/member -type f -mtime +60 ! -name '.*' -exec mv '{}' /backup \;

moves all files modified greater than 60 days ago, that do not begin with a period, to /backup.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0