sort files by depth (bash)

后端 未结 5 2188
半阙折子戏
半阙折子戏 2020-12-19 13:39

Is there a way in bash to sort my files from a directory down in depth order, for example first print the files in the present directory, then the files in the sub directory

5条回答
  •  离开以前
    2020-12-19 14:36

    Use the find command:

    find . -depth
    

    From man find:

    -depth Process each directory's contents before the directory itself.

提交回复
热议问题