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

Linux服务器
用Ubuntu做WEB服务器相关设置
使用Linux的rsync命令实现 多服务器镜像同步
Linux环境下Apache与Tomcat共存
Linux下简单的DNS实例一则
linux系统SendMail详细配置
实现Linux操作系统下DNS服务器的搭建
使用nbspNginxnbsp提升网站访问速度
使用awstats分析Nginx的访问日志
Linux网络中DHCP和DNS服务快速整合
Nginx负载均衡搭建胜过Apache十倍
Linux应用 DHCP服务器的安装和故障排除
ubuntu一步架设ftp服务器图文讲解
DHCP概述及Linux DHCP服务器的配置
Linux集群技术中的热点---虚拟技术
Linux操作系统的防火墙配置:基础篇
Linux DHCP服务器的配置
4步用XAMPP快速搭建LAMP环境
简略讲解对 Linux 服务器的四种入侵级别
浅谈Linux优化及安全配置的个人体会
解读Linux文件权限的设置方法

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


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