Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 12 down vote accepted

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.

share|improve this answer

A quick hack to get more details about the files found by find is to use the -ls output option.

find ./ -name "*.sqlite" -ls

For more precise results enzotib's answer is spot on.

share|improve this answer

This works for me:

$ find ./ -name "*.sqlite" -ls
share|improve this answer
1  
This appears to be a complete duplicate of @Caleb's answer. –  Chris Down Feb 21 at 1:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.