简体   繁体   English

如何使用“查找”命令获取按时间排序的列表(ASC / DESC)。 型f -ls”在Linux中?

[英]How to Get List Sorted by Time(ASC/DESC) Using The Command “find . -type f -ls” in Linux?

How to Get List Sorted by Time(ASC/DESC) Using The Command "find . -type f -ls" in Linux? 如何在Linux中使用“ find。-type f -ls”命令获取按时间排序的列表(ASC / DESC)?

  1. I want to use find command. 我想使用find命令。
  2. I want to get result like using "ls". 我想获得使用“ ls”的结果。

find . 找 。 -type f -ls 型f -ls


[As-Is] [原样]

5113588 0 -rwxr-xr-x 1 root root 0 Jul 31 15:26 ./bbb.txt 5113588 0 -rwxr-xr-x 1根根0 Jul 31 15:26 ./bbb.txt

5113222 0 -rwxr-xr-x 1 root root 0 Jul 17 13:18 ./aaa.txt 5113222 0 -rwxr-xr-x 1根根0 Jul 17 13:18 ./aaa.txt


[To-Be] [成为]

5113222 0 -rwxr-xr-x 1 root root 0 Jul 17 13:18 ./aaa.txt 5113222 0 -rwxr-xr-x 1根根0 Jul 17 13:18 ./aaa.txt

5113588 0 -rwxr-xr-x 1 root root 0 Jul 31 15:26 ./bbb.txt 5113588 0 -rwxr-xr-x 1根根0 Jul 31 15:26 ./bbb.txt



If it's impossible, how can I get list including these by using any other commands? 如果不可能,如何使用其他命令获取包含这些的列表?

1. File size 1.文件大小
2. Time 2.时间
3. File path and name 3.文件路径和名称
4. Include Child Directories 4.包括子目录


Thank you in advance. 先感谢您。

find / -type f -printf "\\n%AD %AT %p" | 查找/ -type f -printf“ \\ n%AD%AT%p” | head -n 11 | 头-n 11 | du -sh 杜什

this will also work, here ls -lhStr 这也可以,在这里ls -lhStr

-l use a long listing format -h with -l, print sizes in human readable format (eg, 1K 234M 2G) -S sort by file size -l使用长列表格式-h和-l,以人类可读格式打印大小(例如1K 234M 2G)-S按文件大小排序

Thank you. 谢谢。 I got it! 我知道了!

find . -type f -exec ls {} -al \;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM