有时候在Linux上查看,当前文件夹下磁盘占用情况,可能会用到命令

du -h -a --max-depth=1
//或简写为
du -ah --max-depth=1

 然鹅,在MacOS上,使用该命令则可能会报错"du: illegal option -- -", 如下:

"du: illegal option -- -" mac上使用du出错

 

 其实,在Mac上可以这样

du -hd1

或者用命令find 来实现,

find . -maxdepth 1 -type d -mindepth 1 -exec du -hs {} \;

 

相关文章:

  • 2021-08-21
  • 2021-06-19
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
猜你喜欢
  • 2022-12-23
  • 2021-11-20
  • 2022-01-09
  • 2022-02-05
  • 2021-10-12
  • 2021-12-04
相关资源
相似解决方案