首页 | 邮件资讯 | 技术教程 | 解决方案 | 产品评测 | 邮件人才 | 邮件博客 | 邮件系统论坛 | 软件下载 | 邮件周刊 | 热点专题 | 工具
网络技术 | 操作系统 | 邮件系统 | 客户端 | 电子邮箱 | 反垃圾邮件 | 邮件安全 | 邮件营销 | 移动电邮 | 邮件软件下载 | 电子书下载

操作系统

Windows 9X | Linux&Uinx | Windows Server | 其它操作系统 | Vista | FreeBSD | Windows 7 |
首页 > 操作系统 > Linux&Uinx > 教你了解 Linux文件系统的使用情况 > 正文

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

出处:5DMail.Net收集整理 作者:5DMail.Net收集整理 时间:2007-11-4 23:09:42
邮件中继服务 七天免费试用
主要涉及df、du、ls等命令

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

    英文说明:

    This manual page documents the GNU version of df. df displays theamount of disk space available on the filesystem containing each filename argument. If no file name is given , the space available on alcurrently mounted filesystems is shown. Disk space is shown in 1K blocksby 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 containinga mounted filesystem, df shows the space available on that filesystemrather than on the filesystem containing the device node(which is alwaysthe root filesystem )。 This version of df cannot show the space availableon unmounted filesystems, because on most kinds of systems doing so requiresvery 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.

    df统计每一目录的使用情况。

    主要参数:

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

    -a统计所有目录和文件,包含隐藏的

    -s 只产生一个统计信息

    -k kB为单位

    -h 易读方式

    -L 不计算符号连接

    -M 以M 为单位。

    详细参考

    -a,——all

    write counts for all files, not just directories

    ——apparent-size

    print apparent sizes, rather than disk usage ; although the apparentsize is usually smaller , it may be

    larger due to holes in(a €?sparsea €?) files, internal fragmentation,indirect blocks , and the like

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

    -b,——bytes

    equivalent to a €?——apparent-size ——block-size=1a €?

    -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 beequivalent 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

    dona€?t 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.

    ——exclude=PATTERN Exclude files that match PATTERN.

    ——max-depth=N

    print the total for a directory (or file , with ——all ) onlyif it is N or fewer levels below the command line

    argument;——max-depth=0 is the same as——summarize

    ——help display this help and exit

    ——version

    output version information and exit

    ls–lh可以看出当前目录文件的大小(不含目录),比如下面的的322M.

    [root@LS-SVR-18 ~]# ls -lh

    total 322M

    -rw-r ——r —— 1 root root 312M Aug 1 23:35 10.50.86.18.tar.z

    -rw-r ——r —— 1 root root 1.3K Aug 1 17:41 anaconda-ks.cfg

    drwxr-xr-x 2 root root 4.0K Aug 1 21:44 Desktop

    -rw-r ——r —— 1 root root 62K Aug 1 17 :41 install.log

    -rw-r ——r —— 1 root root 5.2K Aug 1 17:41 install.log.syslog

    -rw-r ——r —— 1 root root 8.9M Sep 28 15 :29 Install_MSN_Messenger_zhcn.EXE

    -rwxr-xr-x 1 root root 9.2K Aug 16 11 :20 m64

    -rw-r ——r —— 1 root root 1.1K Aug 16 11 :20 m64.c

    -rw-r ——r —— 1 root root 1.1K Aug 8 04:33 m64.o

    drwxr-xr-x 2 root root 4.0K Oct 9 15:45 MCA

    drwxr-xr-x 2 root root 4.0K Oct 9 15:41 MGM

    drwxr-xr-x 2 root root 4.0K Oct 9 15:45 MYSQL

    -rw —— 1 root root 95 Sep 5 10:34 nohup.out

    使用du -sSh 也是同样的结果

    [root@LS-SVR-18 ~]# du -sSh

    322M

    使用du -sh则包含了子目录的内容

    [root@LS-SVR-18 ~]# du -sh

    451M .

    查看每个文件和目录的大小

    [root@LS-SVR-18 ~]# du -sh *

    313M 10.50.86.18.tar.z

    8.0K anaconda-ks.cfg

    8.0K Desktop

    72K install.log

    12K install.log.syslog

    8.9M Install_MSN_Messenger_zhcn.EXE

    16K m64

    8.0K m64.c

    8.0K m64.o

    476K MCA

    65M MGM

    65M MYSQL

    8.0K nohup.out

相关文章 热门文章
  • Linux启动 Sendmail速度慢的解决办法
  • Linux系统下防垃圾邮件基本功能
  • Linux启动sendmail速度慢的解决办法
  • Domino V8 在 UNIX/Linux 平台上的安装及其常见问题
  • IBM Lotus Domino,Linux,虚拟化,可伸缩性:不再是相互排斥的术语
  • 19.11 参 考 资 料
  • 19.10 课 后 练 习
  • 19.9 重 点 回 顾
  • 19.8.3 quota与目录转移
  • 19.8.2 关于备份
  • 19.8.1 问题检查
  • 19.7.8 其他设置技巧
  • linux的基本操作(上)
  • Linux系统下应用知识大荟萃
  • GNU GRUB启动管理器
  • 制作基于软盘的Linux系统
  • 网络配置文件快速解读
  • linux的基本操作(下)
  • 剖析Linux系统启动过程
  • DameWare让局域网管理不再繁琐
  • 在Redhat 9下实现双机热备和集群功能
  • LINUX守护进程介绍
  • Redhat advance server 2.1集群的安装与管理
  • Linux必须学会的60个命令-文件处理
  • 自由广告区
     
    ORF反垃圾邮件软件
    最新软件下载
  • SharePoint Server 2010 部署文档
  • Exchange 2010 RTM升级至SP1 教程
  • Exchange 2010 OWA下RBAC实现的组功能...
  • Lync Server 2010 Standard Edition 标..
  • Lync Server 2010 Enterprise Edition...
  • Forefront Endpoint Protection 2010 ...
  • Lync Server 2010 Edge 服务器部署文档
  • 《Exchange 2003专家指南》
  • Mastering Hyper-V Deployment
  • Windows Server 2008 R2 Hyper-V
  • Microsoft Lync Server 2010 Unleashed
  • Windows Server 2008 R2 Unleashed
  • 今日邮件技术文章
  • 腾讯,在创新中演绎互联网“进化论”
  • 华科人 张小龙 (中国第二代程序员 QQ...
  • 微软推出新功能 提高Hotmail密码安全性
  • 快压技巧分享:秒传邮件超大附件
  • 不容忽视的邮件营销数据分析过程中的算..
  • 国内手机邮箱的现状与未来发展——访尚..
  • 易观数据:2011Q2中国手机邮箱市场收入..
  • 穿越时空的爱恋 QQ邮箱音视频及贺卡邮件
  • Hotmail新功能:“我的朋友可能被黑了”
  • 入侵邻居网络发骚扰邮件 美国男子被重..
  • 网易邮箱莫子睿:《非你莫属》招聘多过..
  • 中国电信推广189邮箱绿色账单
  • 最新专题
  • 鸟哥的Linux私房菜之Mail服务器
  • Exchange Server 2010技术专题
  • Windows 7 技术专题
  • Sendmail 邮件系统配置
  • 组建Exchange 2003邮件系统
  • Windows Server 2008 专题
  • ORF 反垃圾邮件系统
  • Exchange Server 2007 专题
  • ISA Server 2006 教程专题
  • Windows Vista 技术专题
  • “黑莓”(BlackBerry)专题
  • Apache James 专题
  • 分类导航
    邮件新闻资讯:
    IT业界 | 邮件服务器 | 邮件趣闻 | 移动电邮
    电子邮箱 | 反垃圾邮件|邮件客户端|网络安全
    行业数据 | 邮件人物 | 网站公告 | 行业法规
    网络技术:
    邮件原理 | 网络协议 | 网络管理 | 传输介质
    线路接入 | 路由接口 | 邮件存储 | 华为3Com
    CISCO技术 | 网络与服务器硬件
    操作系统:
    Windows 9X | Linux&Uinx | Windows NT
    Windows Vista | FreeBSD | 其它操作系统
    邮件服务器:
    程序与开发 | Exchange | Qmail | Postfix
    Sendmail | MDaemon | Domino | Foxmail
    KerioMail | JavaMail | Winwebmail |James
    Merak&VisNetic | CMailServer | WinMail
    金笛邮件系统 | 其它 |
    反垃圾邮件:
    综述| 客户端反垃圾邮件|服务器端反垃圾邮件
    邮件客户端软件:
    Outlook | Foxmail | DreamMail| KooMail
    The bat | 雷鸟 | Eudora |Becky! |Pegasus
    IncrediMail |其它
    电子邮箱: 个人邮箱 | 企业邮箱 |Gmail
    移动电子邮件:服务器 | 客户端 | 技术前沿
    邮件网络安全:
    软件漏洞 | 安全知识 | 病毒公告 |防火墙
    攻防技术 | 病毒查杀| ISA | 数字签名
    邮件营销:
    Email营销 | 网络营销 | 营销技巧 |营销案例
    邮件人才:招聘 | 职场 | 培训 | 指南 | 职场
    解决方案:
    邮件系统|反垃圾邮件 |安全 |移动电邮 |招标
    产品评测:
    邮件系统 |反垃圾邮件 |邮箱 |安全 |客户端
    广告联系 | 合作联系 | 关于我们 | 联系我们 | 繁體中文
    版权所有:邮件技术资讯网©2003-2010 www.5dmail.net, All Rights Reserved
    www.5Dmail.net Web Team   粤ICP备05009143号