List files with timestamp since epoch
If you have GNU find, you can do it entirely using find
:
find / -printf '%p %C@\n'
The format specifiers are:
%p File's name. %Ck File's last status change time in the format specified by k, which is the same as for %A. %Ak File's last access time in the format specified by k, which is either `@' or a directive for the C `strftime' function. The possible values for k are listed below; some of them might not be available on all systems, due to differences in `strftime' between systems. @ seconds since Jan. 1, 1970, 00:00 GMT, with fractional part.
If you don't want fractional parts, use s
instead of @
as the time format specifier. (There are a few systems without s
, but Linux and *BSD/OSX do have s
.)
find / -printf '%p %Cs\n'
why don't you ask find
to stat
for you ?
find / -exec stat -c'%n %Z' {} +
find will run stat of every entry (file or directory).