If you’ve found this page, it’s most likely because you’re seeking for a solution to free up some disk space on a CentOS 6 or CentOS 7 or CentOS 8 system.
In this post, I’ll try to highlight several simple ways that may be readily executed using the command-line / terminal to complete such tasks; each command has been tried on a CentOS 6 or CentOS 7 or CentOS 8 system, but the majority of them will also function on any other Linux environment.
The following are quick commands to clear disk space on CentOS 6 or CentOS 7 and CentOS 8 servers.
The first step before everything you need to run the below command:
Auto-cleaning your server by executing the below command:
Do you like to clear your server manually? So follow the below steps
1. Trim log files:
3. Orphan packages:
4. WP CLI caches:
5. Old kernels:
6. Composer caches:
7. Core dumps:
8. error_log
files (CPanel):
9. NodeJs caches:
10. Mock caches:
11. Generic program caches:
Conclusion
That’s all there is to it: I genuinely hope that the scripts above will assist you in cleaning up your CentOS drive and freeing up some disk space.