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

Linux服务器
linux轻量级 Web 服务器
apache的多站点虚拟主机配置方法
linux服务器后台设置小技巧
.htaccess设置指南经典说明
Apache中利用mod_rewrite实现防盗链
CentOS Linux 下配置Apache2+PHP5+MySQL5+GD库的方法
实现两台MySQL数据库数据的同步的方法
安全检测Unix和Linux服务器安全设置入门精讲
比较详细的基于CentOS的WWW服务器架设指南
科普Solaris系统安全常用命令小结
Linux ls命令参数详解
Linux tar命令使用列子
Linux 下rpm命令参数详解
linux cat more less显示文件的区别
linux下/etc/passwd文件的选项说明
linux .htaccess 设置 404 等错误页面
.htaccess教程之.httacces文件介绍与创建
.httacces文件的配置技巧
.httacces文件的密码保护和防止盗链的实现方法
.htaccess文件使用教程总结

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-30   浏览: 163 ::
收藏到网摘: 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