当前位置: 首页 > 图文教程 > 服务器 > Linux服务器 > Linux下查看某目录或指定文件大小的命令

Linux服务器
Linux服务器上适用的防火墙分析
NIX下远程连接XServer几个方法
网上第一Mail服务器防垃圾邮件处理
小技巧:为Linux服务器增加新分区
利用Samba3.0轻松搞定PDC域服务器
服务器诊所:Fortran,在Linux上安家
服务器诊所:使虚拟文件系统工作
服务器诊所:编写出色的异常
服务器诊所:在Linux上仿真老式系统
架设Samba服务器,用User共享方式?
Linux下用Samba构建虚拟NT域服务器
在Linux下用Qmail建部门邮件服务器
如何构建Sendmail服务器问题深入分析
全力打造Linux服务器配置大全
菜鸟大学堂:一步一步配置WEB服务器
菜鸟大学堂:理解与应用LDAP服务器
在Linux下建立PPPOE服务器的步骤
在Linux实现基于动态IP的WWW服务器
CVS服务器建立和权限配置完全方案
如何规划一个高容量的Apache服务器

Linux服务器 中的 Linux下查看某目录或指定文件大小的命令


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-30   浏览: 191 ::
收藏到网摘: n/a

du -sh 文件或目录名

用法:du [选项]... [文件]...

总结每个<文件>的磁盘用量,目录则取总用量。

长选项必须用的参数在使用短选项时也是必须的。

-a, --all write counts for all files, not just directories

-B, --block-size=SIZE use SIZE-byte blocks

-b, --bytes print size in bytes

-c, --total produce a grand total

-D, --dereference-args dereference FILEs that are symbolic links

-h, --human-readable 以容易理解的格式印出文件大小 (例如 1K 234M 2G)

-H, --si 类似 -h,但取 1000 的次方而不是 1024

-k 即 --block-size=1K

-l, --count-links 连硬链接的大小也计算在内

-L, --dereference 找出任何符号链接指示的真正目的地

-S, --separate-dirs 不包括子目录的占用量

-s, --summarize 只分别计算命令列中每个参数所占的总用量

-x, --one-file-system skip directories on different filesystems

-X FILE, --exclude-from=FILE Exclude files that match any pattern in FILE.

--exclude=PATTERN Exclude files that match PATTERN.

--max-depth=N print the total for a directory (or file, with --all)

only if it is N or fewer levels below the command

line argument; --max-depth=0 is the same as

--summarize