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.*

Was this answer helpful?

 Print this Article

Also Read

How to run the backup process which is stuck using rsync?

While running the backup process, I was getting the error message as - /usr/bin/rsync -rlptD...

How to install Imagic?

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

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

What is Node.js Exactly? - A beginners introduction to Nodejs

Node means Server and JS means Java Script so in simple words Node.js is a Server Side Java...

Powered by WHMCompleteSolution