Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find and remove large junk files from the server #39

Open
blackchestnut opened this issue Feb 2, 2020 · 1 comment
Open

Find and remove large junk files from the server #39

blackchestnut opened this issue Feb 2, 2020 · 1 comment

Comments

@blackchestnut
Copy link
Owner

Check

$ df -h
# Filesystem      Size  Used Avail Use% Mounted on
# udev            1.9G     0  1.9G   0% /dev
# tmpfs           395M   12M  383M   3% /run
# /dev/sda         79G   16G   60G  21% /
# tmpfs           2.0G  4.0K  2.0G   1% /dev/shm
# tmpfs           5.0M     0  5.0M   0% /run/lock

Find

$ cd /                                                    
$ sudo du -h . | grep '[0-9\.]\+G'
# 4.0G	./var/log/journal
# 4.5G	./var/log
# 5.1G	./var
# 1.6G	./usr
# 1.1G	./home/devops/.rbenv/versions
# 1.1G	./home/devops/.rbenv
# 2.2G	./home/devops
# ...

Delete files older than specific date in linux

$ find ./ ! -newermt "2020-02-01 00:00:00"  | xargs rm -rf
@blackchestnut
Copy link
Owner Author

See also - journalctl disk usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant