- 浏览: 439812 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (538)
- C/C++ Primer (69)
- Objective-C Primer (102)
- Python Primer (19)
- JavaScript Primer (1)
- Java Primer (37)
- PHP Primer (17)
- 泛 Linux (37)
- Shell Script (21)
- APUE (21)
- UNP__1&2 (19)
- NetWork (7)
- Oracle周边 (38)
- Mysql里边 (6)
- Windows技 (9)
- 简单算法 & 数据结构 (14)
- 设计模式 (6)
- GTK历程 (12)
- 工具使用 (25)
- 杂事 (23)
- 一些概念 (17)
- Web方面 (10)
- myCodeTools (9)
- ^未 竟$ (13)
- 硬件通信 (2)
- Games (1)
最新评论
http://www.chinaunix.net/jh/6/465673.html
http://doc.linuxpk.com/151.html
总结:df和du的统计方式不一样。
du:系统“名正言顺”的各类文件
df:系统分配出去的
程序open文件A,而没有close。
用户将文件A删除,df统计时会将文件A占用的block统计上。
Document Id: 26928Synopsis: du and df Differences (originally published 8/91)
Update date: 2001-05-13Description: du and df Differences
-- --- -- -----------
This article explains how reporting disk usage du and reporting free disk space
on file systems df may show different numbers.
du
--
The du user command gives the number of kilobytes contained in all files and,
recursively, directories within each specified directory or file (filename).
If filename is missing, `.' (the current directory) is used. A file which
has multiple links to it is only counted once.
EXAMPLE:
system % du
5 ./jokes
33 ./squash
44 ./tech.papers/lpr.document
217 ./tech.papers/new.manager
401 ./tech.papers
144 ./memos
80 ./letters
388 ./window
93 ./messages
15 ./useful.news
1211 .
Note that the last number, 1211 is the grand total (in kilobytes) for the
directory.
df
--
The df user command displays the following information:
amount of disk space occupied by currently mounted file systems
the amount of used and available space
how much of the file system's total capacity has been used
Used without arguments, df reports on all mounted file systems.
EXAMPLE:
system % df
Filesystem kbytes used avail capacity Mounted on
/dev/ip0a 7445 4714 1986 70% /
/dev/ip0g 42277 35291 2758 93% /usr
Note: used plus avail is less than the amount of space in the file system
(kilobytes) because the system reserves a fraction of the space in the file
system to allow its allocation routines to work well. The amount reserved is
typically about 10%. (This may be adjusted using the tunefs command. Refer to
the man pages on tunefs(8) for more information.) When all the space on a file
system, except for this reserve, is in use, only the super-user can allocate
new files and data blocks to existing files. This, however, may cause the file
system to be over allocated. When a file system is over allocated in this way,
df may report that the file system is more than 100% utilized.
If arguments to df are disk partitions (for example, /dev/ip0as or path names),
df produces a report on the file system containing the named file. Thus, df
shows the amount of space on the file system containing the current directory.
Problem Definition
------- ----------
This section gives the technical explanation of why du and df sometimes report
different totals of disk space usage.
When a program that is running in the background writes to a file while the
process is running, the file to which this process is writing is deleted.
Running df and du shows a discrepancy in the amount of disk space usage. The
df command shows a higher value.
Explanation Summary
----------- -------
When you open a file, you get a pointer. Subsequent writes to this file
references this file pointer. The write call does not check to see if the file
is there or not. It just writes to the specified number of characters starting
at a predetermined location. Regardless of whether the file exist or not, disk
blocks are used by the write operation.
The df command reports the number of disk blocks used while du goes through the
file structure and and reports the number of blocks used by each directory. As
far as du is concerned, the file used by the process does not exist, so it does
not report blocks used by this phantom file. But df keeps track of disk blocks
used, and it reports the blocks used by this phantom file.
发表评论
-
Wireshark Proxifier
2013-02-25 20:42 1103介绍:网络封包分析软件 简单的用法: http://www. ... -
进程管理...无内容
2013-01-14 16:52 547进程管理...无内容进程管理...无内容进程管理...无内容 ... -
系统服务相关……学习中
2013-01-01 21:57 649……学习中 -
开机自动启动……学习中
2013-01-01 21:56 563.........学习中 -
源码编译
2013-01-01 21:41 9382年没在linux编译过第三方库,都忘了有这回事。 拿到一份 ... -
YUM
2013-01-01 21:19 638YUM = Yellow dog Updater, Modif ... -
host rename
2013-01-01 20:48 535http://www.ichiayi.com/wiki/tec ... -
上传、下载
2012-12-27 21:35 525scp 本地文件 user@ip:pwd wget curl ... -
环境变量
2012-12-09 20:38 572系统 /etc/profile /etc/bashrc 个 ... -
VIM 学习
2012-12-07 15:04 810动画互动教程Good!! ht ... -
CentOS 目录
2012-12-07 14:20 732http://www.cnblogs.com/ellisonD ... -
CentOS HTML
2012-12-07 12:18 1403ssh user@ip 了解CentOS 5.4 32位的目 ... -
16 个 Linux 服务器监控命令
2012-03-14 23:57 728http://www.oschina.net/question ... -
小指令
2011-06-02 10:16 44ssh -p xxxx userName@xx.xx.xx ... -
Ubuntu__新装常用
2011-04-18 21:51 642--rz sudo apt-get install lrzs ... -
CMD__nohup 后台运行
2011-02-17 10:28 875http://www.qqread.com/linux/200 ... -
CMD__find
2011-01-05 12:08 620源文:http://blog.csdn.net/w ... -
系统信息查询
2011-01-04 11:03 523系统版本: uname -a 编码: cat /etc/sy ... -
chown__group权限
2010-12-24 13:30 675#组 chgrp groupName path #修改 ... -
Unix平台下的程序
2010-12-09 11:39 523red hat: rpm -ql 相关安装路径 rpm - ...
相关推荐
CentOS中du和df 的区别
df du命令详细解释 文件大小 系统管理员需理解的一些关键东西
Linux 基础 83-系统信息-03-df和du查看磁盘和目录空间占用.flv
linux下,发现 du、df 硬盘空间不同,介绍了相关的解决方法
Linux运维-操作系统 教程 从入门到精通101课-46-46文件系统命令-df分区du大小.mp4
• du:disk usage • df:disk free • lsof:list open files • echo "" > access.log
一、df显示文件系统的使用情况,与du比?,是更全盘化。 经常使用的是 df -T,显示文件系统的使用情况并显示文件系统的类型。 举比例如以下: [root@localhost ~]# df -T Filesystem Type 1K-blocks ...
大数据基础-Linux基础详解课程
Linux du命令也是查看使用空间的,但是与df命令不同的是Linux du命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的. du /bin和du -s /bin有什么区别呢? -s 就是summary, 显示该目录占用空间的...
该工具使用 Unix du/df 工具来收集文件系统数据并对其进行格式化,以便可以在 d3.js 树图中显示。 这是通过以类似于flare.json 的格式生成json 来实现的。 此外,Unix ls 程序用于收集文件数据,然后在单击树状图时...
du命令也是查看使用空间的,但是与df命令不同的是Linux du命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的。 语法 du [选项][文件] 选项 -a或-all 显示目录中个别文件的大小。 -b或-bytes 显示...
但是与df命令不同的是du命令是对文件和目录磁盘使用的空间的查看,而不是某个分区。 语法格式:du [参数] [文件] 常用参数: -a 显示目录中所有文件大小 -k 以KB为单位显示文件大小 -m 以MB为单位...
功率开关器件产生的du/dt是开关电源中的主要干扰源之一,IGBT与功率MOSFET在开通和关断时产生的|du /dt|的大小是不同的,这是在分析和处理电力电子装置和系统的干扰时必须注意的一个问题。如图是一台IGBT电压型桥式...
系统状态相关命令,包括top、free、df、du和ps;以及服务器工作中常用的SSH连接命令、系统管理命令、网络管理命令和Web服务器相关命令。通过本文的介绍和示例,读者可以更好地了解和掌握这些常用命令,以便在Linux...
这种情况下,通过df和du命令查找的磁盘空间,两者是无法匹配的,可能df显示磁盘100%,而du查找目录的磁盘容量占用却很小。 遇到这种情况,基本可以断定是某些大文件被某些程序占用了,并且这些大文件已经被删除了,...
Linux中du-查看文件夹大小并按大小进行排序详解 某天,我想检查一下电脑硬盘的的使用情况,作为一个命令控,废话少说,开始吧: 使用df 命令查看当前磁盘使用情况: jack@jiaobuchong:~$ df -lh Filesystem Size ...
Linux du命令也是查看使用空间的,但是与df命令不同的是Linux du命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的。
但是与df命令不同的是du命令是对文件和目录磁盘使用的空间的查看,而不是某个分区。 语法 du 【选项】 【参数】 选项 -a或-all:显示目录中个别文件的大小。 -b或-bytes:显示目录或文件大小时,以byte为单位。 ...
1、使用gdisk进行分区:...4、df、du命令练习。 5、创建文件名lntest“this is link test!”, 创建硬链接①修改文件内容,查看变化,②删除源文件查看变化 创建软链接①修改文件内容,查看变化,②删除源文件查看变化
09.2.1 文件系统管理-文件系统常用命令-df、du、fsck、dumpe2fs.mp4 09.2.2 文件系统管理-文件系统常用命令-挂载命令.mp4 09.2.3 文件系统管理-文件系统常用命令-挂载光盘与U盘.mp4 09.2.4 文件系统管理-文件系统...