Day: May 13, 2020

Clearing space in filesystem

Times it is very essential to follow housekeeping of the filesystem in a Linux server

There are old junk and trace files that needs to erased intermittently to keep the server and the databases healthy

we can display the filesystem details to check if the space of filesystem is full

~] df -h

If ‘/’ root filesystem is full then you are into risk of crashing the server

In that case,you have to make wise decisions to either extend the filesystem space or delete the most unwanted files on the server

The kernel sends a signal called OOM (out of memory) to kill the server processes randomly and upon the demand of the applications running on the system.If there is no room for the other processes to accomodate

we can check the errors in /var/log/messages

To calculate the size of each files

~] du -sh filename

~] du -sh *

~] du -csh *

To find the files with a search pattern and delete the trace and logfiles

$ find /go/to/dir/ -type d -name "dirname" -exec rm -rf {} +

To remove a file manually

$ rm -rf filename

Hence clean up the filesystem regularly to avoid nightmares !!