Last active
May 30, 2018 13:24
-
-
Save jamesstacyjones/c70e38c69eca0806305e5426f9140907 to your computer and use it in GitHub Desktop.
Command line to find large files in linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find top 20 largest files starting at root directory | |
du --exclude=/proc* -a / | sort -n -r | head -n 20 | |
List the size of of the folders in the current directory | |
du -hsx * | sort -rh | head -10 | |
Checks processes that are keeping deleted files open | |
lsof -s | grep deleted | sort -k 8 | |
Check rotation of error logs ... as it is not working large files are being created | |
logrotate -d /etc/logrotate.conf | |
Cool check that will give the totals of each folder in the root directory as well as the total space being used by the server. | |
.. if not being used there then it is probably a process maybe using a deleted file | |
du -x -d1 -h / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment