I am running the following command:
find . -atime -30
However in the output, I would like it to display the time stamp of access time. Also would like it to show the user that accessed the file if at all possible.
Can you help?
Thanks.
Use the printf option of find:
find . -atime -30 -printf '%u %Ac %p\n'
Take a look at man find for the different printf formatting options.
find . -atime -30 -print0 | xargs -0 ls -lud
You can't determine who accessed the file, this information is not generally recorded.
Bear in mind that atime is not always updated (depends on the file system mount options).
If you want to restrict the find to just files, then you can do:
find . -atime -30 -a -type f -print0 | xargs -0 ls -lud
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With