![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Little bit weired : Find files in UNIX w/o using find or where command | jatin.jain | Shell Programming and Scripting | 10 | 09-19-2007 06:47 AM |
| UNIX Find command in Borne Shell | marshaferry | Shell Programming and Scripting | 1 | 04-06-2006 11:47 AM |
| how to find a file in UNIX without find command? | bluo | Shell Programming and Scripting | 3 | 09-24-2003 11:47 PM |
| How to find the exit status of last command in Unix? | rajugp1 | High Level Programming | 1 | 09-10-2002 11:52 AM |
| how to find a command in Unix? | lacasa | UNIX for Dummies Questions & Answers | 1 | 02-22-2001 03:49 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
The UNIX find command
Hi All,
I trying to get my head around using the find command and i wanted to list a selection of files that are older than 30 days. i used 'find . -mtime +30' and it lists all the files including other files from the current location's sub directory. i then used the prune option but it seems it doesn't work 'find . -mtime +30 -prune'. The location i am trying to find files is in my local directory /local/home/***/print/ the directory print has sub directory called 'backup'. any help kindly appreciated. Mani |
|
||||
|
I may have read the posting incorrectly, but if you are attempting to exclude the the backup and/or print subdirectory and operate only on the the rest of the home, then:
find /local/home/username -name print -prune -o -mtime +30 -ls mutliple prunes if you want (spaces important) find /local/home/username \( -name print -o -name dir2 -o -name dir3 \) -prune -o -mtime +30 -print -David |
|
||||
|
hi, thanks for all your replies.
dmwaff, apologies for any misunderstanding, what i wanted was to find the contents 30+ days old only in the print directory and not its subdirectory "backup" i tried : find /local/home/*username*/print/ -name print -prune -o -mtime +30 and it returns everything 30+ days old in 'print' and in the sub directory 'backup'. i tried: find . -prune -mtime +30 and it doesn't return anything even with a -ls option at the end. i went back one directory into my username directory and tried the following commands find . -name 'print' -mtime +30 find ./ -name print -mtime +30 but nothing, no display or error message of incorrect usage even with an -ls or -prune option. I did a check on the contents of the directory and there are files dating back from 2006, from May and June 2007, which it should pick up and display ![]() |
| Sponsored Links | ||
|
|