List files by last edited date

前端 未结 4 2147
时光说笑
时光说笑 2020-12-07 13:31

I have a directory: /home/user/

How can I list every file in this directory (including those in sub directories) and order them by the date that they we

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 14:22

    You can use:

    ls -Rt
    

    where -R means recursive (include subdirectories) and -t means "sort by last modification date".


    To see a list of files sorted by date modified, use:

    ls -l -Rt
    

    An alias can also be created to achieve this:

    alias lt='ls -lht'
    lt
    

    Where -h gives a more readable output.

提交回复
热议问题