List the timestamp of the files in “find” command

find

In bash, if I use $ find ./ -name "*.sqlite" , it will list all the sqlite files in current directory. I also want to see the modified time of the files, can anybody give me some help?

Best Answer

You can add to find the following expression:

-printf '%Tc %p\n'

to see something like

Sun Aug 14 06:29:38 2011 ./.nx/config/host.nxs

or -printf '%TD %TT %p\n' for

08/14/11 06:29:38.2184481010 ./.nx/config/host.nxs

or -printf '%T+ %p\n' if you have GNU find, to see

2011-08-14+06:29:38.2184481010 ./.nx/config/host.nxs

This last one, if available, is also useful for time sorting purposes.

See manual page of find, where it talks about printf.

Related Question