關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • Linux 下找出大容量檔案

    Posted on February 17th, 2006 Sam Tang 3 comments

    以下指令可以找出檔案體積大於 50MB 的檔案,並列出檔案名稱及檔案大小:

    find / -type f -size +50000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’


     

    3 responses to “Linux 下找出大容量檔案”

    1. bash: syntax error near unexpected token `|’

    2. should be:

      find / -type f -size +50000k -exec ls -lh {} \; | awk ‘{ print $8 “: ” $5 }’

      (tested okay in dapper)

      find / -type f -size +50000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’

      (tested okay in sarge)

    3. 多謝指正!

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word