<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Decode360's Blog

    業精于勤而荒于嬉 QQ:150355677 MSN:decode360@hotmail.com

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 ::  :: 管理 ::
      397 隨筆 :: 33 文章 :: 29 評論 :: 0 Trackbacks
    Linux磁盤管理命令[du|df]
    ?
    ?
    ??? 來了解一下Linux下對磁盤進行查看和控制的兩個命令。這兩個命令都比較好用,非常需要的功能,而且參數也不復雜。Linux我不熟悉,基本上都是從網上搜集資料學習,記在博客中,以方便今后匯總查詢。好,簡單學習一下:
    ?
    ?
    一、du命令

    首先看一下du的help說明:
    ---------------------------------
    ?
    [root@misdwh opt]# du --help
    Usage: du [OPTION]... [FILE]...
    ? or:? du [OPTION]... --files0-from=F
    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'
    ? -c, --total?????????? produce a grand total
    ? -D, --dereference-args? dereference FILEs that are symbolic links
    ????? --files0-from=F?? summarize disk usage of the NUL-terminated file
    ????????????????????????? names specified in file F
    ? -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
    ? -m??????????????????? like --block-size=1M
    ? -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 file systems
    ? -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)
    ????????????????????????? only if it is N or fewer levels below the command
    ????????????????????????? line argument;? --max-depth=0 is the same as
    ????????????????????????? --summarize
    ????? --time??????????? show time of the last modification of any file in the
    ????????????????????????? directory, or any of its subdirectories
    ????? --time=WORD?????? show time as WORD instead of modification time:
    ????????????????????????? atime, access, use, ctime or status
    ????? --time-style=STYLE show times using style STYLE:
    ????????????????????????? full-iso, long-iso, iso, +FORMAT
    ????????????????????????? FORMAT is interpreted like `date'
    ????? --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.
    ?
    ?
    ?
    ?
    ?
    ?
    語法:du [ -a | -s ] [ -k ] [ -m ] [ -g ][ -l ] [ -r ] [ -x ] [ -H | -L ][ File ... ]
    ?
    描述:du命令顯示用于文件的塊數量。如果指定的File參數實際上是一個目錄,就要報告該目錄內的所有文件。如果沒有提供File參數,du命令使用當前目錄內的文件。 如果File參數是一個目錄,那么報告的塊的數量就是分配到目錄中文件以及分配到目錄自身的塊之和。
    ?
    指定-a標志:報告個體文件中塊數量。不管是否使用了-a標志,由File參數指定的個體文件總是要列出。
    指定-s標志:報告用于所有指定文件和目錄中所有文件的全部塊。
    ?
    ---------------------------------

    分類解說一下各個參數的含義:
    ?
    -a 顯示文件夾中的所有文件夾、文件的大小。默認只顯示文件夾大小,不顯示文件。
    -B 以xxByte為單位顯示塊數(默認為1024)
    -b 以1Byte為單位顯示塊數(但貌似與-B1的結果不同)
    -c 最后顯示一行匯總數據
    -h 以方便閱讀的方式展現大小(是以1000為單位,而非1024)
    -k 用 1024 字節單位計算塊數,而不是用缺省的 512 字節單位。
    -m 用 MB 單位計算塊數,而不是用缺省的 512 字節單位。
    -0 注意是數字“0”,而非字母“O”。表示每行后面不換行,直接跟下去
    -S 外層的文件夾大小不包含內層大小

    -s 只顯示整個對象文件夾的合計大小。將該標志與-a標志進行對比。
    -x 在評估文件大小時,只評估那些與File參數指定的文件或者目錄駐留在相同設備上的文件。
    ?
    ?
    注:
    1、具有多個鏈接的文件只為一個條目計數和書寫。
    2、由于塊計數只基于文件大小,所以在報告的塊數中,未分配的塊是沒有包含進去的。
    3、如果du得不到文件屬性,或者無法讀取目錄,它就報告一個錯誤,并且會影響命令的退出狀態。
    4、如果同時指定-k、-m標志,則后面的那個起作用。且輸出結果四舍五入。
    ?

    退出狀態:
    ?
    此命令返回下列出口值:
    =0 成功結束。
    >0 發生錯誤。
    ?
    ?
    ?
    二、df命令
    ?
    同樣先來看help說明
    ---------------------------------
    ?
    [root@misdwh devMISowb]# df --help
    Usage: df [OPTION]... [FILE]...
    Show information about the file system on which each FILE resides,
    or all file systems by default.
    ?
    Mandatory arguments to long options are mandatory for short options too.
    ? -a, --all???????????? include dummy file systems
    ? -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 file systems
    ????? --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 file systems of type TYPE
    ? -T, --print-type????? print file system type
    ? -x, --exclude-type=TYPE?? limit listing to file systems 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命令可顯示所有文件系統對i節點和磁盤塊的使用情況。
    ?
    各個選項的含義如下:?
    ?
    -a 顯示所有文件系統的磁盤使用情況,包括0塊(block)的文件系統,如/proc文件系統。?
    -B 以xxByte為單位顯示塊數(默認為1024)
    -h 以方便閱讀的方式展現大小(是以1024為單位)
    -H 以方便閱讀的方式展現大小(是以1000為單位)
    -i 顯示i節點信息,而不是磁盤塊。
    -k 以k字節為單位顯示。?
    -P 以POSIX格式輸出結果(不換行?)
    -t 后面跟“=type類型”,顯示各指定類型的文件系統的磁盤空間使用情況。
    -T 顯示文件系統類型。
    -x 后面跟“=type類型”,列出不是某一指定類型文件系統的磁盤空間使用情況(與t選項相反)。?
    ?
    ?
    ?
    顯示內容說明:
    ?
    $ df?
    ?
    Filesystem 1K-blocks?? Used? Available Use% Mounted on?
    /dev/hda2? 1361587?? 1246406????? 44823 97% /?
    ?
    df命令的輸出清單的第1列是代表文件系統對應的設備文件的路徑名( 一般是硬盤上的分區);第2列給出分區包含的數據塊(1024字節)的數目;第3、4列分別表示已用的和可用的數據塊數目。用戶也許會感到奇怪的是:第3、4列塊數之和不等于第2列中的塊數。這是因為缺省的每個分區都留了少量空間供系統管理員使用。即使遇到普通用戶空間已滿的情況,管理員仍能登錄和留有解決問題所需的工作空間。清單中Use%列表示普通用戶空間使用的百分比,即使這一數字達到100%,分區仍然留有系統管理員使用的空間。最后,Mounted on列表示文件系統的安裝點。?

    ?
    ?
    posted on 2009-06-29 23:01 decode360 閱讀(538) 評論(0)  編輯  收藏 所屬分類: 03.Linux
    主站蜘蛛池模板: 亚洲av福利无码无一区二区| 国产精品亚洲w码日韩中文| 久久综合图区亚洲综合图区| 亚洲精品色在线网站| 在线日韩av永久免费观看| 亚洲一区二区三区国产精华液| 一二三四在线播放免费观看中文版视频 | 在线观看免费毛片| 亚洲人成人77777网站不卡| 91高清免费国产自产拍2021| 亚洲天天在线日亚洲洲精| 98精品全国免费观看视频| 亚洲精品免费在线| 无码国产精品一区二区免费I6| 亚洲一级毛片免费看| 午夜爱爱免费视频| AV激情亚洲男人的天堂国语| 亚洲国产天堂久久综合| 中文字幕在线成人免费看| 亚洲国产精品va在线播放| 久久国产精品2020免费m3u8| 亚洲自偷精品视频自拍| 国产免费AV片在线播放唯爱网| 亚洲欧洲免费无码| 亚洲精品岛国片在线观看| 免费91最新地址永久入口 | 一个人看的免费视频www在线高清动漫 | 人成免费在线视频| 久久精品国产亚洲综合色| 蜜臀AV免费一区二区三区| 中文字幕亚洲精品无码| 亚洲不卡无码av中文字幕| 国产在线观看免费视频软件| 亚洲福利视频网站| 国产免费av片在线播放| 久久国产乱子伦精品免费午夜| 久久亚洲精品无码VA大香大香| 毛片免费视频播放| 老司机精品免费视频| 亚洲一区二区影视| 亚洲综合色在线观看亚洲|