Friday, December 2, 2022

Calculate total size of all the text files in current directory in bash

 du -bc *.txt | tail -1 | cut -f 1

 if the extension is variable

ext="txt"

du -bc *.$ect | tail -1 | cut -f 1


Source: https://unix.stackexchange.com/questions/72661/show-sum-of-file-sizes-in-directory-listing

No comments:

Post a Comment