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

后端 未结 11 1499
遥遥无期
遥遥无期 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 09:02

    Apparently --max-depth option is not in Mac OS X's version of the du command. You can use the following instead.

    du -h -d 1 | sort -n

提交回复
热议问题