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

Linux服务器
htaccess Rewrite中文编码问题解决方法
缓存服务器的建立原理分析
Nginx虚拟主机多server_name的顺序问题
Nginx+PHP+MySQL双机互备、全自动切换方案
Nginx 0.7.x + PHP 5.2.6(FastCGI)+ MySQL 5.1 在128M小内存VPS服务器上的配置优化
VPS 配置优化笔记
解决Nginx + PHP(FastCGI)遇到的502 Bad Gateway错误
apache tomcat 一个网站多域名的实现方法
SSH 登录工具常用命令
httpd.conf 二级域名设置方法
linux 安装配置lamp v2
Tomeat6.0 连接池数据库配置
让你知道什么是 SVN
用rsync对网站进行镜像备份实现步骤
linux备份与恢复基础知识
限制 Apache日志文件大小的方法
Linux+Nginx+Php架设高性能WEB服务器
linux Apache CGI 安装配置
Apache 认证总结
Apache 二级域名实现方法介绍

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


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