Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Linux 中输出目录大小?
我目前正在使用“du /root/test”,但得到以下结果:
第754章
我只需要输出如下数字:
754
du /root/test | awk '{print $1}'
由于您的目录可能有子目录,因此使用 -s 作为摘要:
du -s /root/test |awk '{print $1}'