HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: HPUX list files with access time more than 5 m...
Operating System - HP-UX
1829002
Members
2747
Online
109986
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
08-17-2005 02:43 AM
08-17-2005 02:43 AM
HPUX list files with access time more than 5 min
Hi, does anyone know how to find files who have the last access time bigger than 5 min ago, in linux i use:
find ./ -amin +5 -type f -maxdepth 1 -name "*.*"
but in hp-ux the find command doesn't have the -amin option....
find ./ -amin +5 -type f -maxdepth 1 -name "*.*"
but in hp-ux the find command doesn't have the -amin option....
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2005 02:49 AM
08-17-2005 02:49 AM
Re: HPUX list files with access time more than 5 min
Use the touch command to create a reference file of the appropriate time (man touch). Then use find with the -newer option, referencing the "touched" file (man find). In this case it sounds like you would want to use the "not newer" option: ! -newer.
Pete
Pete
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2005 02:50 AM
08-17-2005 02:50 AM
Re: HPUX list files with access time more than 5 min
You will need to use the -newer switch along with a temporary file.
eg: -
touch 200517081030 /tmp/fiveminutesago
find . -newer /tmp/fiveminutesago
The fun may be generating the timestamp to use. Capturing "date +%Y%d%m%H%M" will give you "now" time, then you'll need to subtract 5 from it, taking into account the hhmm going below 0000 and having to roll back the day/month/year etc as appropriate. Shouldn't be too hard to script, but clearly not as elegant as the GNU find method.
eg: -
touch 200517081030 /tmp/fiveminutesago
find . -newer /tmp/fiveminutesago
The fun may be generating the timestamp to use. Capturing "date +%Y%d%m%H%M" will give you "now" time, then you'll need to subtract 5 from it, taking into account the hhmm going below 0000 and having to roll back the day/month/year etc as appropriate. Shouldn't be too hard to script, but clearly not as elegant as the GNU find method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2005 02:51 AM
08-17-2005 02:51 AM
Re: HPUX list files with access time more than 5 min
You first use the touch command with -a option to create a reference file with a given timestamp. Next you use find ./ -newera reffile. Man touch, find for details.
UNIX ain't Linux.
UNIX ain't Linux.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP