bash - list files in a directory based on timestamp -


in bash, there command line list files in directory based on timestamp. e.g.,

\ls -ltr dir/file*  -rw-r--r-- 1 anon  root   338 aug 28 12:30 g1.log -rw-r--r-- 1 anon  root  2.9k aug 28 12:32 g2.log -rw-r--r-- 1 anon  root  2.9k aug 28 12:41 g3.log -rw-r--r-- 1 anon  root  2.9k aug 28 13:03 g4.log -rw-r--r-- 1 anon  root  2.9k aug 28 13:05 g5.log 

i want list files have timestamp before aug 28 13:00.

update :

]$ find -version gnu find version 4.2.27 features enabled: d_type o_nofollow(enabled) leaf_optimisation selinux  

you can use find command if know number of days

find ./ -mtime -60 

+60 means looking file modified 60 days ago.

60 means less 60 days.

60 if skip + or - means 60 days.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -