free-tech

Running Out Of Space


Running out of space Linux/Unix? 

First step check which directory taking the most space in your system


- sudo du -h / --max-depth=1 | sort -hr

then remove the log files that are taking most of the space.

Second step run those commands lines:


sudo apt-get autoremove

sudo du -sh /var/cache/apt

sudo apt-get autoclean

sudo apt-get clean

check system logs


sudo journalctl --disk-usage

free up 2 days  logs or more 

sudo journalctl --vacuum-time=2d

Diagnose and Address the Issue


Inspect the Syslog File: Check the contents of the syslog file to see what kind of messages are being logged frequently.

sudo less /var/log/syslog

Manual Cleanup: If necessary, you can manually clear or truncate the syslog file. Be cautious with this approach, as you might lose important log information.

sudo truncate -s 0 /var/log/syslog

or

sudo rm /var/log/syslog
sudo systemctl restart rsyslog