前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >How to Summarize Folder Size in Terminal

How to Summarize Folder Size in Terminal

作者头像
技术小黑屋
发布2018-09-04 16:35:02
5240
发布2018-09-04 16:35:02
举报
文章被收录于专栏:技术小黑屋技术小黑屋

In this post, we will use the du command. This command does estimate file space usage; and It will summarize disk usage of each FILE, recursively for directories.

The description on the arguments we will use.

-h, —human-readable print sizes in human readable format (e.g., 1K 234M 2G) -s, —summarize display only a total for each argument

How to Summarize a single Folder Size

1 2 3

#Summarize the current folder size. 11:33:57-androidyue~/googlecode$ du -sh 85M .

Summarize a certain folder size.

1 2

11:34:03-androidyue~/googlecode$ du -sh apps-for-android/ 11M apps-for-android/

How to summarize multiple folders sizes

1 2 3 4 5 6

11:35:17-androidyue~/googlecode$ ls | xargs du -sh 11M apps-for-android 22M depot_tools 740K _gclient_src_fo4RrR 42M gerrit 11M reviewboard-read-only

More detailed information

ls – list directory contents Description:List information about the FILEs (the current directory by default) xargs – build and execute command lines from standard input

Others

  • Linux Bible
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • How to Summarize a single Folder Size
  • Summarize a certain folder size.
  • How to summarize multiple folders sizes
  • Others
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档