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
Post a Comment