HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- problems with the "last accessed" time on a file
Operating System - HP-UX
1827289
Members
3266
Online
109717
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
05-15-2008 12:15 PM
05-15-2008 12:15 PM
problems with the "last accessed" time on a file
I have some developer files on a dev server that are owned by a former employee. The account has been disabled, but these outstanding files have become a problem. It seems that he has moved some scripts into place that are both useful and necessary, but they are owned by him. I want to be able to find out how many more of these there are without my last experience in trial and error.
I have tried to use find with the -atime flag. However, it does not appear to work. If a file is opened or read, I would expect that to count as an access. It only seems to change the accessed property when the modified property is changed. Am I doing something wrong? All of these are using HP-UX 11.00 and higher.
Thanks.
I have tried to use find with the -atime flag. However, it does not appear to work. If a file is opened or read, I would expect that to count as an access. It only seems to change the accessed property when the modified property is changed. Am I doing something wrong? All of these are using HP-UX 11.00 and higher.
Thanks.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2008 12:20 PM
05-15-2008 12:20 PM
Re: problems with the "last accessed" time on a file
The find command with the -atime switch will find the defined access time ( the first time ). The find command itself will cause an update to the access time when it runs so effectively you can only run this once
( this is stated in the man pages for find )
( this is stated in the man pages for find )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2008 12:29 PM
05-15-2008 12:29 PM
Re: problems with the "last accessed" time on a file
Hi Troy:
Make sure that you are looking at the files you think you are:
# find /tmp -xdev -type f -atime -14 -exec ls -ul {} \+
...would find *files* (but not directories) in the '/tmp' path whose last-access time was during the last 14-days. The files meeting this criteria would have their *last-access* timestamp printed with an 'ls -ul'.
The addition of '-xdev' prevents crossing mountpoints. This is necessary if you are examining the '/' directory and want to visit directories like '/etc/ and '/sbin', but not '/tmp' or '/var'.
By the way, merely opening a file does not change its last access time. You must read/execute it to change this value.
Regards!
...JRF...
Make sure that you are looking at the files you think you are:
# find /tmp -xdev -type f -atime -14 -exec ls -ul {} \+
...would find *files* (but not directories) in the '/tmp' path whose last-access time was during the last 14-days. The files meeting this criteria would have their *last-access* timestamp printed with an 'ls -ul'.
The addition of '-xdev' prevents crossing mountpoints. This is necessary if you are examining the '/' directory and want to visit directories like '/etc/ and '/sbin', but not '/tmp' or '/var'.
By the way, merely opening a file does not change its last access time. You must read/execute it to change this value.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2008 11:32 PM
05-15-2008 11:32 PM
Re: problems with the "last accessed" time on a file
Hi Troy,
you could try a different approach. If the user still exists in /etc/passwd, e.g. name "developerX" you can try searching for files owned by him, e.g.:
# find / -user developerX
If the user does no longer exist you can search for unowned files, e.g.:
find / -nouser
both possibilities can of course be used in combination with other options.
regards,
John K.
you could try a different approach. If the user still exists in /etc/passwd, e.g. name "developerX" you can try searching for files owned by him, e.g.:
# find / -user developerX
If the user does no longer exist you can search for unowned files, e.g.:
find / -nouser
both possibilities can of course be used in combination with other options.
regards,
John K.
it would be nice if you always got a second chance
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP