LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   File size (https://www.linuxquestions.org/questions/linux-newbie-8/file-size-4175503335/)

akhilesh_03 04-29-2014 07:29 AM

File size
 
Dear All,

I have a server that is constantly losing disk space.
What is the good way to find which files size is increasing and by how much.
Will it be possible to find which files size is increased by how much??

Thanks in advance

wstewart90 04-29-2014 07:34 AM

I'd expect a linux server administrator to know how to do that already or at least find out in a more efficient manner. Try the du command with a depth of 1 and sort the output numerically. Do that from the root directory and work your way down starting with the directory taking up the most amount of space. (Hint it's usually a log file that isn't rotating frequently enough, possibly in the /var directory).

schneidz 04-29-2014 07:35 AM

lsof will probably help. this is what i do from time to time:
Code:

sudo find / -type f -printf "%s \t\t%p\n" | sort -nr > ~/file-sizes.txt
sudo find / -type d -exec du -b -d 0 -S '{}' \; | sort -nr > ~/dir-sizes.txt


wstewart90 04-29-2014 07:37 AM

^ Is your name Willie or are you talking about me?

szboardstretcher 04-29-2014 08:23 AM

He doesn't seem to be talking about anyone. Schneidz gave the correct and fastest answer. Thats all.

schneidz 04-29-2014 08:26 AM

Quote:

Originally Posted by wstewart90 (Post 5161182)
^ Is your name Willie or are you talking about me?

simpsons reference.

szboardstretcher 04-29-2014 08:29 AM

Nice. I didn't see your signature!


I like my OS's like this:

http://i.imgur.com/guMzXlZ.jpg

akhilesh_03 05-02-2014 01:57 AM

Thanks a lot to you all for your replies...


All times are GMT -5. The time now is 12:12 AM.