几个Linux 文件夹命令

来源:互联网 发布:风乎舞雩得乎 编辑:程序博客网 时间:2024/05/29 04:41

 

df :df 使用df命令查看linux磁盘剩余空间


[root]# df -hl
文件系统                        容量        已用       可用       已用% 挂载点
/dev/hda5                    487M     120M       342M   27%    /
/dev/hda1                    981M      21M        911M    3%
/boot none                   125M      0            125M    0%
/dev/shm /dev/hda2     29G        4.9G       23G     18%
/home /dev/hda3          20G        4.8G       14G     27%    /usr
/dev/hda7                     24G        510M       22G    3%      /var
/dev/hdb2                    75G         75G          0       100%   /

df是以磁盘分区为单位来查看文件系统。
/dev/hdb2 75G 75G 0 100% /, 以此为例。
表示HD硬盘接口的第二个硬盘(b),第二个分区(2),容量是75G,用了75G,可用是0,因此利用率是100%, 被挂载到根分区目录上(/)     
另外简单的一个办法就是鼠标右键查看磁盘、文件夹属性,就能了解到已用多少,剩余多少空间。在我自己的开发板上使用的结果



du - estimate file space usage


SYNOPSIS
       du [OPTION]... [FILE]...

DESCRIPTION
       Summarize disk usage of each FILE, recursively for directories.

       Mandatory arguments to long options are mandatory for short options too.

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

           -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
              donâ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.

判断一个文件夹多大:

du -sh foldername