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 !!

Published by kishan

You will know about me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: