shell - Using "du" for Total File Size of Certain File Types -


i have been using du command size of directory:

du /tmp/dir1 

this produced total size of files:

7   /tmp/dir1 

which parse , use details.

this folder full of .txt , txr files. interested in total size of *.txt files.

is there way can odify du command produce single line output of size of *.txt files?

pass list of files du command. example:

du -s /tmp/dir1/*.txt 

a possible solution getting total size last line of du's output, in:

du -c /tmp/dir1/*.txt | tail -1 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -