1752489 Members
5568 Online
108788 Solutions
New Discussion юеВ

Re: find command

 
khilari
Regular Advisor

find command

hi guys, just wondering is there a way to use the find command to get date and time as well, because usually we just get the filename which fulfills that criteria such as filesize more than > 1 mb or files that was accessed more than 10 days ago but dont get date and time or the input like we get with ls -l.....
4 REPLIES 4
Pete Randall
Outstanding Contributor

Re: find command

Sure:

find /startdir -size nnnn -atime nnn -exec ll {} \;


Pete

Pete
Ganesan R
Honored Contributor

Re: find command

Hi,

Two ways you can do this.

#find /var -size +5000 |xargs ls -al

#find /var -size +5000 -exec ll {} \;
Best wishes,

Ganesh.
Jestin John Chacko
Regular Advisor

Re: find command

Dear,

may be you are asking for the mtime option of find


find -mtime +number of days

you can see more in man find


Dennis Handly
Acclaimed Contributor

Re: find command

If you are going to use "-exec ll", then you either need to exclude directories or add -d:
find /startdir -type f -size nnnn -atime nnn -exec ll {} +
find /startdir -size nnnn -atime nnn -exec ll -d {} +

Note: Use "+" for performance, instead of xargs.