½ÌÄãÁ˽â LinuxÎļþϵͳµÄʹÓÃÇé¿ö

ÉÏһƪ / ÏÂһƪ  2008-05-10 18:33:29 / ¸öÈË·ÖÀࣺLinux

 

Ö÷ÒªÉæ¼°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¨Clh¿ÉÒÔ¿´³öµ±Ç°Ä¿Â¼ÎļþµÄ´óС£¨²»º¬Ä¿Â¼£©£¬±ÈÈçÏÂÃæµÄµÄ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


TAG: Linux

 

ÆÀ·Ö£º0

ÎÒÀ´ËµÁ½¾ä

Open Toolbar