Link to home
Start Free TrialLog in
Avatar of juli_ann
juli_ann

asked on

How to display the last time files were accessed.

I need a way to show the last time (date) each .sqr file was accessed on a solaris 9 server.  It seems there is a difference between the last time modified, and last time accessed.  What I need to know, if possible, is if a file was read or modified, or both  (We have a group of developers that have tons of .sqr files, some that are very old, and are not in use any more.   I need to identify files that no one has even read in the last year).  

I tried using:

find /  -name *.sqr -atime -365

but that seems to show only files that were accessed on a specified date, instead of listing the access time of every .sqr file.

Ultimately, these .sqr files need to be grouped by user, and then listed by the last time it was read or modified
 
Please let me know if I need to provide any other information.

Thanks for your help!
Juliann  

Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

"last access time" depends on the process that accesses the file updating the inode with the timestamp;  To be honest, I don't know what system utilities do and don't do that, so it's not very reliable :-(

find /  -name *.sqr -atime -365   should list all files accessed within the last year;  To display the actual access time, use `ls -lu` or `ls -tu`

SOLUTION
Avatar of colinbo
colinbo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial