Digital Marketing

How to calculate sum size of files

 For example, sum size of all MySQL bin log files:

$ sudo du -cb /var/lib/mysql/mysql-bin.* | awk 'END{print $1}'


option -b will display each file in bytes and -c will print the total size.

To calculate a specific date, such as Jul 1st:

 $ sudo ls -l /var/lib/mysql/mysql-bin.*  | grep "Jul 1" | awk '{print $9}' | xargs du -cb | awk 'END{print $1}'



Popular posts from this blog

Fixed WSL sshd: no hostkeys available -- exiting

PowerMTA pmta command

How to fix: mv: failed to preserve ownership