LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 928|回复: 12

在console下用什么命令查看文件夹的大小??

[复制链接]
发表于 2004-8-26 23:00:14 | 显示全部楼层 |阅读模式
如题~~
发表于 2004-8-26 23:04:58 | 显示全部楼层
du -sh /dir
 楼主| 发表于 2004-8-27 00:11:25 | 显示全部楼层
thanks
发表于 2004-8-27 20:04:26 | 显示全部楼层
收下,
发表于 2004-8-27 21:55:02 | 显示全部楼层
最初由 KornLee 发表
du -sh /dir


请问参数怎么解释.
发表于 2004-8-27 21:59:02 | 显示全部楼层
jia@hua:~$ df --help
用法:df [选项]... [文件]...
显示每个<文件>所在的文件系统的信息,默认是显示所有文件系统。

长选项必须用的参数在使用短选项时也是必须的。
  -a, --all             包括大小为 0 个块的文件系统
  -B, --block-size=大小 块以指定<大小>的字节为单位
  -h, --human-readable  以容易理解的格式印出文件系统大小 (例如 1K 234M 2G)
  -H, --si              类似 -h,但取 1000 的次方而不是 1024
  -i, --inodes          显示 inode 信息而非块使用量
  -k                    即 --block-size=1K
  -l, --local           只显示本机的文件系统
      --no-sync         取得使用量数据前不进行 sync 动作 (默认)
  -P, --portability     使用 POSIX 输出格式
      --sync            取得使用量数据前先进行 sync 动作
  -t, --type=类型       只印出指定<类型>的文件系统信息
  -T, --print-type      印出文件系统类型
  -x, --exclude-type=类型   只印出不是指定<类型>的文件系统信息
  -v                    (此选项不作处理)
      --help     显示此帮助信息并离开
      --version  显示版本信息并离开

SIZE may be (or may be an integer optionally followed by) one of following:
kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.

Report bugs to <bug-coreutils@gnu.org>.
jia@hua:~$
发表于 2004-8-27 22:00:45 | 显示全部楼层
没有 -s 参数呀
发表于 2004-8-27 22:19:57 | 显示全部楼层
[php]/home/lee/test#du --help
用法: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
      --help     显示此帮助信息并离开
      --version  显示版本信息并离开

<大小>可以是以下的单位 (单位前可加上整数):
kB=1000,K=1024,MB=1000000,M=1048576,还有 G、T、P、E、Z、Y 如此类推。

Report bugs to <bug-coreutils@gnu.org>.
/home/lee/test#du --version
du (coreutils) 4.5.3
由 Torbjorn Granlund, David MacKenzie, Larry McVoy, and Paul Eggert 编写。

Copyright (C) 2002 Free Software Foundation, Inc.
这是自由软件;请参考原始码的版权声明。本软体不提供任何保证,甚至不会包括
可售性或适用於任何特定目的的保证。
/home/lee/test#
OS:redhat linux 9.0
[/php]
发表于 2004-8-27 22:20:38 | 显示全部楼层
du or df ?
发表于 2004-8-27 22:28:14 | 显示全部楼层
最初由 ys_freedom 发表
du or df ?

df用于显示所有文件系统信息
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表