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.

how to find large files using command line linux?

Discussion in 'General Discussion' started by spaceman, Aug 28, 2006.

  1. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    OK, I confess, this question has zero to do with cPanel/WHM...

    We've got a local linux dev server that is running out of space big time. Something is chewing up drive space. What linux command lines and options are my friend in identifying where my space is being chewed up? 'df' tells me that /var is 97% used, but what can I do to learn most efficiently which files in /var are the culprits?

    Thanks.
     
  2. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Code:
    find '/' -size +50000k
    replacing 50000k with whatever size you would be lookin' for, and the '/' with the appropriate directory...

    edit: sry, posted above solely based on your msg subject. If you want to know about only the /var directory you could use above with '/var' in place of '/', however I would look at your logs directory and see what in there is or isnt' being rotated. First guess is that your logs are growing out of control. GL!
     
    #2 mctDarren, Aug 28, 2006
    Last edited: Aug 28, 2006
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yup, I'd guess logs and mysql databases as the most common cause. Using du is your best bet.
     
  4. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Thanks guys. I got a good result from

    du -sh /var/*

    Turned out that log level setting in smb.conf (Samba) was set to '3' which results in huge log files been written. Changed it to 1 (0 is 'off' I believe), deleted historical logs, all good.
     
Loading...

Share This Page