Getting file sizes

Kent Johnson kent37 at tds.net
Mon Oct 22 09:36:45 EDT 2007


Jim Kuzdrall wrote:
> On Monday 22 October 2007 09:11, Kent Johnson wrote:
>> How can I get the total size, in K, of all files in a directory that
>> match a pattern?
>>
>> For example, I have a dir with ~5000 files, I would like to know the
>> total size of the ~1000 files matching *.txt.
> 
>     Ah!  Perhaps I actually know an answer to this one.  (Very rare) 
> 
>     Go to directory of interest and try
>     du -shc *.txt

That still lists each file individually, it needs to pipe to tail as 
Stephen suggested.

Kent


More information about the gnhlug-discuss mailing list