| Forum

How to cleanup diskspace when filesystem utilisation is 100% in Linux

When I execute df -h, I can see /var is 100% utilized. I am not sure which files or folders can be deleted to free up some space. Can someone help me to find out any temporary files or log files which grows frequently and can be deleted safely?

I will not be able to tell which files to delete but I can give you some suggestions.

  1. Use the command du -sh * to see which folder or file utilizes more space. There might be some binaries or large files which caused the issue. You can delete it or move it to some other location if they are not useful.
  2. Use the find /var -name *log to find the log files. Copy all the log files to a folder (log_folder) and archive it using tar -cvf log_folder.tar log_folder. Or delete the log files which are dated long back and not required anymore.