A PHP Error was encountered

Severity: Warning

Message: call_user_func_array() expects parameter 1 to be a valid callback, class 'Articles' does not have a method 'dr_fetch'

Filename: libraries/Commonclass.php

Line Number: 464

A Professional Web Hosting Company based in Chandigarh, India
Submitted by Kirti Singh on 23/Apr/2020 11:45
Several times a Linux or Unix admin may need to get cumulative size of files based on certain parameter especially the file type.

In this example we are going to get cumulative size of *conf type files within a folder

Method 1 : This lets us take file size only in the current folder. It does not traverses the directory tree.

##################

sum=0;for i in `du -b *conf|tr -s '\t' ' '|cut -d ' ' -f1`; do sum=$((sum+i)); done; echo $sum

##################

Method 2 : Using this example we are able to traverse the directory tree.

##################

sum=0;for i in `find . -type f -name "*conf" -exec du -b {} \;|tr -s '\t' ' '| cut -d ' ' -f1`; do sum=$((sum+i)); done ; echo $sum

##################

For a video demonstration, please checkout the video below


Joomla
Joomla
Wordpress
WordPress
Drupal
Drupal
Magento
Magento
CakePHP
CakePHP
OSCommerce
osCommerce
IMG 6