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 SOAP on CentOS?

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

How to install Imagic?

1. # yum install ImageM* netpbm gd gd-* libjpeg libexif gcc coreutils make 2.  # cd...

How to install Postfix on CentOS?

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

How to install latest version of git on CentOS release 6.8 (Final)?

Install latest version of git on CentOS release 6.8 - Step 1. Install Dependencies - yum install...

How to setup PPTP VPN?

A Point-To-Point Tunneling Protocol (PPTP) allows you to implement your own VPN very quickly, and...

Powered by WHMCompleteSolution