gpt4 book ai didi

unix - linux ls -ltr 按名称排序

转载 作者:行者123 更新时间:2023-12-03 23:15:51 28 4
gpt4 key购买 nike

我在 上看到这个网站上的很多问题ls 排序
但我需要的是一个排序的输出 ls -ltr (按文件名排序)
因为我还需要文件大小和日期进行比较。
我试过 |排序 -k , |排序 , ls-1ltr 没有成功。

这是未排序的列表:

ser@xeroxsqa02:/app/java/jars> ls -ltr
total 41940
-rwxr-xr-x 1 xeroxadmin mqm 331471 May 10 2017 spring-aop-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 153115 May 10 2017 jdom-1.1.jar
-rwxr-xr-x 1 xeroxadmin mqm 185140 May 10 2017 commons-io-2.4.jar
-rwxr-xr-x 1 xeroxadmin mqm 279193 May 10 2017 commons-lang-2.5.jar
-rwxr-xr-x 1 xeroxadmin mqm 489884 May 10 2017 log4j-1.2.17.jar
-rwxr-xr-x 1 xeroxadmin mqm 53081 May 10 2017 spring-asm-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 2095932 May 10 2017 ojdbc5-11.2.0.3.0.jar
-rwxr-xr-x 1 xeroxadmin mqm 4467 May 10 2017 aopalliance-1.0.jar
-rwxr-xr-x 1 xeroxadmin mqm 38460 May 10 2017 joda-convert-1.2.jar
-rwxr-xr-x 1 xeroxadmin mqm 1891110 May 10 2017 guava-13.0.1.jar
-rwxr-xr-x 1 xeroxadmin mqm 589824 May 10 2017 spring-beans-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 449324 May 10 2017 spring-core-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 232019 May 10 2017 commons-beanutils-1.8.3.jar
-rwxr-xr-x 1 xeroxadmin mqm 831068 May 10 2017 spring-context-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 569231 May 10 2017 joda-time-2.0.jar
-rwxr-xr-x 1 xeroxadmin mqm 52915 May 10 2017 commons-logging-1.1.jar
-rwxr-xr-x 1 xeroxadmin mqm 107225 May 10 2017 spring-context-support-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 176311 May 10 2017 spring-expression-3.1.1.RELEASE.jar
drwxr-xr-x 2 xeroxadmin mqm 46 Jun 30 2017 bkp
-rwxr-xr-x 1 xeroxadmin mqm 1599570 Jan 17 19:12 axis-1.4.jar
-rwxr-xr-x 1 xeroxadmin mqm 79796 Jan 17 19:12 commons-discovery-0.5.jar
-rwxr-xr-x 1 xeroxadmin mqm 148429 Jan 17 19:12 wsdl4j-1.6.2.jar

最佳答案

您是否尝试过以下操作:

ls -lru

每个手册页:

-u with -lt: sort by, and show, access time; with -l: show access time and sort by name; otherwise: sort by access time, newest first

关于unix - linux ls -ltr 按名称排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50931114/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com