Disk Usage Useful Command

Note - You can replace /home with correct '/' drive on your server

1. Checking the disk usage - du -sch *

2. Checking the disk usage of hidden files - du -shc .??* *

3. Find error logs more than 250 MB on server -  find /home -name "error_log*" -size +250M -exec ls -hl {} \;

4. Find Backups more than 100 MB on server - /home -name "*backup" -size +100M -exec ls -lh {} \;

5. Find zip files on server - find -name "*.zip" | awk '{system ("du -sh "$1)}' ;

6.Find tar files on server -  find -name "*.tar" | awk '{system ("du -sh "$1)}' ;

7. Find tar.gz files on server - find -name "*.tar.gz" | awk '{system ("du -sh "$1)}' ;

8. Find zip and tar files on server - cd /home; ll | grep zip; ll | grep tar; 

9. Remove stuff from trash 2 days and older -  find /home/*/.trash/ -ctime +2 -type f -exec rm -fv {} \; 

10. Removing backups -

rm -rf */backup-*; 
rm -rf */application_backups; 
rm -rf */softaculous_backups;

11. Removing Error log - rm -f */public_html/error_log ;

12. Removing stderr.log - rm -f /usr/local/apache/logs/stderr.log.*
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to install AVG Antivirus scanner on Ubuntu?

AVG free is antivirus which protects from spyware as well malware. It is free to use for private...

How to setup a WordPress website on plain Centos server?

The following steps have been successfully tested on a plain centos server. Now lets start...

How to change the port number of Apache Web Server?

Default port to access the Apache is 80. Secure port for communicating with world for Apache is...

How to install Postfix on CentOS?

Postfix is an open-source Mail Transport Agent (MTA), which supports protocols like LDAP, SMTP...

How to install SOAP on CentOS?

Install SOAP on CentOS 1) Fire below command - yum install php-soap Output will be as follow...

Powered by WHMCompleteSolution