How to list the size of each file and directory and sort by descending size in Bash?

后端 未结 11 1510
遥遥无期
遥遥无期 2020-12-07 08:02

I found that there is no easy to get way the size of a directory in Bash?

I want that when I type ls -, it can list of all the sum o

11条回答
  •  难免孤独
    2020-12-07 08:58

    Simple and fast:

    find . -mindepth 1 -maxdepth 1 -type d | parallel du -s | sort -n
    

    *requires GNU Parallel.

提交回复
热议问题