1)查看某目录或指定文件大小的命令
du -sh 文件或目录名 ph
2)查看某磁盘分区大小的命令
df -h
参考:
[root@linuxserver redhat]# du --help
用法:du [选项]... [文件]...
总结每个<文件>的磁盘用量,目录则取总用量。
长选项必须用的参数在使用短选项时也是必须的。
-a, --all write counts for all files, not just directories
--apparent-size print apparent sizes, rather than disk usage; although
the apparent size is usually smaller, it may be
larger due to holes in (`sparse) files, internal
fragmentation, indirect blocks, and the like
-B, --block-size=SIZE use SIZE-byte blocks
-b, --bytes equivalent to `--apparent-size --block-size=1
-c, --total produce a grand total
-D, --dereference-args dereference FILEs that are symbolic links
-H like --si, but also evokes a warning; will soon
change to be equivalent to --dereference-args (-D)
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
--si like -h, but use powers of 1000 not 1024
-k like --block-size=1K
-l, --count-links count sizes many times if hard linked
-L, --dereference dereference all symbolic links
-P, --no-dereference dont follow any symbolic links (this is the default)
-0, --null end each output line with 0 byte rather than newline
-S, --separate-dirs do not include size of subdirectories
-s, --summarize display only a total for each argument
-x, --one-file-system skip directories on different filesystems
-X FILE, --exclude-from=FILE Exclude files that match any pattern in FILE.
[root@linuxserver redhat]# 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.