![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find 3 months old log files and remove | cvdev | SUN Solaris | 13 | 05-22-2008 02:38 PM |
| deleting files with dates 3 months ago | godalle | UNIX for Dummies Questions & Answers | 3 | 11-08-2005 03:03 AM |
| Last modification times of files less than 6 months old | Abhishek Ghose | UNIX for Dummies Questions & Answers | 1 | 10-19-2005 08:37 AM |
| Find files older than 5 days and remove tem after listing | ypatel6871 | UNIX for Dummies Questions & Answers | 1 | 09-05-2005 12:00 PM |
| Recursive directory listing without listing files | psingh | UNIX for Dummies Questions & Answers | 4 | 05-10-2002 11:52 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Using the find command is one way - check the man page as there are examples.
Just be careful about removing files older than 2 months as a system files are normally older than two months and could also be removed. find ./ -name "*" -ctime +60 -exec rm {} \; You can use ctime, atime or mtime (Important - don't get the last part wrong as very bad things can happen!!! Try it some time on a test system.) |
|
||||
|
I will create one file with timestamp two months back and
search for newer files. eg. #touch -t 0112310000 /xyz #find / -newer /xyz -print -exec ls -ls {} \; Refer manual pages of touch and find for mor info Hope it helps Regards Sharad |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|