热门关键字:  ubuntu  分区  Fedora  linux系统进程  函数

了解Linux文件系统的使用情况

来源: 作者: 时间:2007-11-02 Tag: 点击:

主要涉及df、du、ls等命令

 

df 统计文件系统的使用情况。

 

英文说明:

This manual page documents the GNU version of df. df displays the amount of disk space available on the filesystem containing each file name argument. If no file name is given, the space available on all currently mounted filesystems is shown. Disk space is shown in 1K blocks by default, unless the environment variable POSIXLY_CORRECT

is set, in which case 512-byte blocks are used.

 

If an argument is the absolute file name of a disk device node containing a mounted filesystem, df shows the space available on that filesystem rather than on the filesystem containing the device node (which is always the root filesystem). This version of df cannot show the space available on unmounted filesystems, because on most kinds of systems doing so requires very nonportable intimate knowledge of filesystem structures.

 

要点如下:

 

如果不加参数,显示现在加载的文件系统。默认单位1K-blocks。如果设置了POSIXLY_CORRECT,则以512-byte blocks为单位。该命令针对文件系统,而不是目录,尽管的给的参数可以是目录。

 

主要参数:

空 显示现在加载的文件系统,不包含0块空间

-a 包含0块空间

-h 易读方式

-k kB为单位

-l 本地

-T 显示文件系统类型

--sync 返回结果前调用sync命令(有什么用呢?)

 

实例:

[root@Mother_FLASH ~]# df

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/md0 28826556 1507948 25854292 6% /usr

/dev/md1 19220436 9153312 9090780 51% /var

/dev/ram1 158667 85032 73635 54% /

/dev/shm 1037388 0 1037388 0% /dev/shm

 

[root@Mother_FLASH ~]# df -ah

Filesystem Size Used Avail Use% Mounted on

/dev/md0 28G 1.5G 25G 6% /usr

/dev/md1 19G 8.8G 8.7G 51% /var

/dev/ram1 155M 84M 72M 54% /

/dev/proc 0 0 0 - /proc

/dev/sys 0 0 0 - /sys

/dev/devpts 0 0 0 - /dev/pts

/dev/shm 1014M 0 1014M 0% /dev/shm

none 0 0 0 - /proc/sys/fs/binfmt_misc

 

详细的参考:

 

-a, --all

include filesystems having 0 blocks

 

-B, --block-size=SIZE use SIZE-byte blocks

 

-h, --human-readable

print sizes in human readable format (e.g., 1K 234M 2G)

 

-H, --si

likewise, but use powers of 1000 not 1024

 

-i, --inodes

list inode information instead of block usage

 

-k like --block-size=1K

 

-l, --local

limit listing to local filesystems

 

--no-sync

do not invoke sync before getting usage info (default)

 

-P, --portability

use the POSIX output format

 

--sync invoke sync before getting usage info

 

-t, --type=TYPE

limit listing to filesystems of type TYPE

 

-T, --print-type

print filesystem type

 

-x, --exclude-type=TYPE

limit listing to filesystems not of type TYPE

 

-v (ignored)

 

--help display this help and exit

 

--version

output version information and exit

 

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.

 




相关文章:
Linux - 增加 Swap 方法
UFS - Unix File System
Linux下如何备份分区表
Ext2文件系统转换为Ext3的方法
Linux Filesystems
proc文件系统
linux 文件系统
/boot不要单独分区!
解析linux根文件系统的挂载过程
理解和认识udev
proc文件系统探索 之 以数字命令的目录[三]
如何自动装配文件系统autofs
linux文件系统基础知识
Linux下增加swap space
autofs服务动态自动挂载各种文件系统
挂载LVM分区
/dev/null 找不到设备的问题
Linux 文件系统(filesystem)资源索引
zfs snapshot
ext2, ext3, xfs, reiserfs 文件系统性能测试
给mss增加ext3空间
Linux为什么最多能分4个四个主分区的解释
制作jffs2 根文件系统
Linux文件系统 一分钱一分货
linux加密分区的创建和使用
onlineJFS无法使用问题(HP_UX)
Linux磁盘存储区管理原理与技巧
udev学习
以NAS价位获取FC文件系统性能
Linux下以模块方式安装卸载文件系统