![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Purge files based on timestamp avl in file name | sureshg_sampat | Shell Programming and Scripting | 3 | 02-29-2008 11:28 AM |
| Little bit weired : Find files in UNIX w/o using find or where command | jatin.jain | Shell Programming and Scripting | 10 | 09-19-2007 07:47 AM |
| Read from file then purge or archive. | kayarsenal | Shell Programming and Scripting | 15 | 08-10-2006 09:24 AM |
| Purge files, keep 3 versions of last 4 days | blt123 | Shell Programming and Scripting | 7 | 10-28-2002 09:49 PM |
| purge xterm | noobie_doo | UNIX for Dummies Questions & Answers | 1 | 03-27-2002 03:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Find and purge a files in a dir
HI All,
I have recuirement to purge the files in a directory . In that directory i an having many sub-directory . When i use find command like find ~/work/test/insert -name "*.*" -mtime +12 it is listing the file not accesed before 12 , It also takes the subdirectories inside the directory ~/work/test/insert . I want to conside only this directory , not the subdirectories in find . PLease let me know how i can be done. offcourse i searched the form but this is not working for me find ~/work/test/insert \(! -name ."*.*") -type f -mtime +1 -print Thanks, Arun. |
|
||||
|
i know this command is wrong
find ~/work/test/insert \(! -name ."*.*") -type f -mtime +1 -print i have also done as find ~/work/test/insert \(! -name ."*.*"\) -type f -mtime +1 -print the same is also not working .... is there is a way to do this to find only in a directory omitting its sub directory??? |
|
||||
|
find . ! -name . -prune -mtime +1
This commands work for me .. But i need to specify hthe directory .. If i do like this find /working/can/transfer ! -name . -prune -mtime +1 or find /working/can/transfer ! -name . -prune "*.*" -mtime +1 is not working . please let mew know what needs to change .. Thanks, Arun |
|
||||
|
That was really great !... Thanks...
Just a question my command is find /working/can/transfer/ -name "*.*" -mtime +1 -exec rm -f -r is there is any way to work with this command like include -prune i tried with find /working/can/transfer/ -name -prune "*.*" -mtime +1 -exec rm -f -r it is not working can i know why it is ???.. Thanks, Arun |
![]() |
| Bookmarks |
| Tags |
| mtime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|