zoukankan      html  css  js  c++  java
  • 【linux】的文件按时间排序

    > ls -alt # 按修改时间排序
    > ls --sort=time -la # 等价于> ls -alt
    > ls -alc # 按创建时间排序
    > ls -alu # 按访问时间排序
     
    # 以上均可使用-r实现逆序排序
    > ls -alrt # 按修改时间排序
    > ls --sort=time -lra # 等价于> ls -alrt
    > ls -alrc # 按创建时间排序
    > ls -alru # 按访问时间排序

    实例:按文件生成时间倒序排列

    [root@67 log]# ls -alt
    总用量 92
    drwxr-x---. 6 root root 4096 10月 14 15:55 ..
    drwxr-x---. 2 root root 4096 10月 14 15:55 .
    -rw-r-----  1 root root  896 10月 14 15:55 result-42.txt
    -rw-r-----  1 root root  602 10月 14 15:50 result-41.txt
    -rw-r-----  1 root root  896 10月 14 14:03 result-40.txt
    -rw-r-----  1 root root  898 10月 14 12:54 result-39.txt
    -rw-r-----  1 root root  896 10月 14 12:13 result-38.txt
    -rw-r-----  1 root root 1181 10月 14 08:54 result-37.txt
    -rw-r-----  1 root root 1178 10月 14 08:13 result-36.txt
    -rw-r-----  1 root root 1181 10月 13 22:54 result-35.txt
    -rw-r-----  1 root root 1178 10月 13 22:12 result-34.txt
    -rw-r-----  1 root root 1181 10月 13 12:54 result-33.txt
    -rw-r-----  1 root root 1178 10月 13 12:12 result-32.txt
    -rw-r-----  1 root root 1181 10月 13 08:54 result-31.txt
    -rw-r-----  1 root root 1178 10月 13 08:13 result-30.txt
    -rw-r-----  1 root root 1181 10月 12 22:54 result-29.txt
    -rw-r-----  1 root root 1178 10月 12 22:12 result-28.txt
    -rw-r-----  1 root root 1181 10月 12 12:54 result-27.txt
    -rw-r-----  1 root root 1178 10月 12 12:12 result-26.txt
    -rw-r-----  1 root root  898 10月 12 08:54 result-25.txt
    -rw-r-----  1 root root  896 10月 12 08:12 result-24.txt
    -rw-r-----  1 root root  898 10月 11 22:54 result-23.txt
    -rw-r-----  1 root root  896 10月 11 22:12 result-22.txt

    参考文档:LINUX的文件按时间排序

  • 相关阅读:
    Recommender Systems 基于知识的推荐
    粒子群优化算法简介
    彻底弄懂LSH之simHash算法
    c++ 字符串函数用法举例
    Linux上的运行的jar包
    推荐系统判定标准
    python 细枝末节
    PV UV
    python解析json
    生成n对括号的所有合法排列
  • 原文地址:https://www.cnblogs.com/kaerxifa/p/11672100.html
Copyright © 2011-2022 走看看