Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    166
    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:
    166
    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:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice