- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Find Command
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-17-2008 01:12 PM
11-17-2008 01:12 PM
I want to find out the files under a directory which are modified from past 2 days. Then what syntax should I use with find command.
Is the below format okay .........
find /opt -xdev -mtime 2 -exec ll {} \;
Thanks * regards,
Kavita
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2008 01:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2008 01:18 PM
11-17-2008 01:18 PM
Re: Find Command
Use this:
# find /opt/ -xdev -type f -mtime -2 -exec ls -l {} +
This limits your search to *files* that have been modified sometime in the last 2-days (where a day is exactly 24-hours). The '-exec' argument is terminated with a "+" instead of a ";". This causes multiple arguments to be passed to your 'ls' greatly reducing the number of forked processes and thereby greatly improving overall performance.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2008 03:45 PM
11-17-2008 03:45 PM
Re: Find Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2008 04:10 PM
11-17-2008 04:10 PM
Re: Find Command
Yes. But it is exact. It will not return files modified exactly 2 days ago or 2.5.
Caution, if you export UNIX95, the dates are completely different.
>how can I find a file under a directory which is growing continuously with find command
This requires you to create a "database" with the size the last time you checked.
Of course, if the file is always being appended, then all you need is that it was modified.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2008 05:09 PM
11-17-2008 05:09 PM