#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    12
    Rep Power
    0

    Files space in / partition


    Hi all,

    I have a question on how to find out the files consuming high memory in the / partition. Have tried with other some of the
    Code:
    find / -name "*" -type f -xdev -ls | sort -nr +6 | head -20
    or

    Code:
    find / -type f -ls | sort -k 7 -r -n | head -10
    but I end up with the largest files in entire system rather than only for root.

    Thanks!!
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,428
    Rep Power
    4539
    Take a look at the du command

    Or even better, jdiskreport works fine on linux as long as you have java. With it you get a nice clickable pie chart of disk space usage.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. D'oh!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    East Coast
    Posts
    75
    Rep Power
    73
    I usually use du from the cli or Baobab from my desktop. Baobab is the standard Gnome 2 utility under System Tools > Disk Usage Analyzer - I've never used jdiskreport, but from what I can tell Baobab gives the same but with a little more detail on the clickable chart. Baobab also allows you to scan remote filesystems via ssh, ftp or similar. I'm not sure if jdiskreport does this or not, but jdiskreport does run on Windows and I'm not sure if Baobab does that or not.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    12
    Rep Power
    0

    Smile


    Thanks All!!


    I tried using du, but I am unable to sort it according to the size of the file. Can you help me with this
  8. #5
  9. Providing fuel for space ships
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2004
    Location
    nr Edinburgh, Scotland
    Posts
    14,382
    Rep Power
    3848
    Simpler to just do a:
    Code:
    ls -hlrS /
    The 'S' flag sorts by file size
    The No Ma'am commandments:

    1.) It is O.K. to call hooters 'knockers' and sometimes snack trays
    2.) It is wrong to be French
    3.) It is O.K. to put all bad people in a giant meat grinder
    4.) Lawyers, see rule 3
    5.) It is O.K. to drive a gas guzzler if it helps you get babes
    6.) Everyone should car pool but me
    7.) Bring back the word 'stewardesses'
    8.) Synchronized swimming is not a sport
    9.) Mud wrestling is a sport
  10. #6
  11. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,428
    Rep Power
    4539
    In fedora 15 you'd need ls -hlRS

    on my system du puts the size output in the 1st column, you can just pipe the output to sort
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,442
    Rep Power
    1688
    Try:
    Code:
    du -xaSk / | sort -nr | head -10
    For the du command the -x prevents multiple filesystems being reported on, the -a causes files to be reported, the -S stops sub-directory sizes being included in the reporting and the -k forces all sizes to be in KB, to make sorting easier.
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo