2015年3月31日星期二

Print the modified date of the file in Linux

There are many ways to check the modified date of the file.
(1) For simplify, use ls -l
(2) use stat
   Here,
   1)the 'find' command will print the modification date for every file recursively.
   2)sort -n(numerically) -r(for reverse) or you can use "sort -nr"
   3)head -n 1: get the first entry or use "sed 1q".
(3) use -printf to avoid calling stat repeatedly
    Now, there we go!

没有评论:

发表评论