- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- problem about "find"
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2007 04:58 PM
11-15-2007 04:58 PM
problem about "find"
find /u1/pucka/cap/4gl -mtime -30 -exec ls -l {} \;
But I failed.because I found some files are in 2004.
How can I fix this issue.
Louis,chenlin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2007 05:29 PM
11-15-2007 05:29 PM
Re: problem about "find"
find /u1/pucka/cap/4gl -mtime -30 -exec ls -l {} +
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2007 05:34 PM
11-15-2007 05:34 PM
Re: problem about "find"
find /u1/pucka/cap/4gl -mtime 30 -exec ls -l {} \;
hope this help....
otherwise RTFM....
man find
BR,
Kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2007 05:37 PM
11-15-2007 05:37 PM
Re: problem about "find"
Your find will find directories and those could have those 2004 files. So do:
$ find /u1/pucka/cap/4gl -mtime -30 -exec ll -d {} +
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2007 05:45 PM
11-15-2007 05:45 PM
Re: problem about "find"
I suggest you check again. The word problem that uses "last N days" would mean some time between today - N and today. find(1) says:
-n means less than n
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2007 09:57 PM
11-15-2007 09:57 PM
Re: problem about "find"
you could try something like this:
$ find /u1/pucka/cap/4gl -type f -mtime -30 -exec ls -l {} \;
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2007 12:06 AM
11-16-2007 12:06 AM
Re: problem about "find"
You made a classis mistake. If you truly only want FILES then you need to specify that restriction:
# find /u1/pucka/cap/4gl -type f -mtime -30 -exec ls -l {} \;
Otherwise, as 'find' descends the starting path you will do an 'ls' on DIRECTORIES that have been modified within the last 30-days and may indeed report FILES in those directories that have been modified in more or less than that time you specified.
If you want DIRECTORIES that have been modified during the last 30-days, then you would do:
# find /u1/pucka/cap/4gl -type d -mtime -30 -exec ls -ld {} \;
Note, too, that in this case, we add the '-d' switch to the 'ls' argument that we want 'find' to execute to _restrict_ 'ls' to examining only the directory.
Lastly, if you are running 11.11 or later (I hope), better performance (less spawned tasks) will occur if you change the '\;' terminator to a "+". This bundles multiple arguments together instead of forking on 'ls' for each argument. See the 'find' manpages for details.
Regards!
...JRF...