The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Viewing Disk Space Usage

Discussion in 'General Discussion' started by Jeff75, Oct 14, 2003.

  1. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    Can somebody tell me if there's a way to only show files/folders that are 1 MB or larger in a directory? For example, if I run "ls -lh" it will show the size of the files/folders in bytes, kilobytes, or megabytes. I'd like to just show the files/folders that are in megabytes.

    cPanel.net Support Ticket Number:
     
  2. Jemshi

    Jemshi Well-Known Member

    Joined:
    Sep 11, 2003
    Messages:
    210
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    you will have to find folders and files separately.

    ls wont show the folder size.

    something like this should do.

    Files :

    ls -Shls | grep "^\ *[0-9]*.[0-9]*M\ "

    Folders :

    find . -not -name . -type d -maxdepth 1 -exec du -sh {} \; | grep "^[0-9].*[0-9]*M"

    Cheers

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page