find directories having size greater than x MB

前端 未结 1 519
南方客
南方客 2020-12-25 11:35

Is it possible to find the directories only having size large than x MB. Suppose, I want to find all the directories only whose size is large than 1000MB with only 1 maxdept

相关标签:
1条回答
  • 2020-12-25 12:18

    If I'm interpreting your question right, I think this might be what you want:

    cd /home
    du -sm * | awk '$1 > 1000'
    

    This will show all directories in /home that contain more than 1000MB. If your version of du doesn't support -m, you can use du -sk and adjust the awk bit to look for more than 1,000,000KB instead...

    0 讨论(0)
提交回复
热议问题