how to know size of a file

Oneyed oneyed at
Tue Jul 1 01:37:53 PDT 2003

On Tue, 1 Jul 2003 01:12:23 -0700 (PDT)
layman <layman82 at> wrote:

> how do i store it directly in a variable (bash), 
FILESIZE=$(du -sh <filename> | gawk -F " " '{ print$1 }')

sets the variable FILESIZE to the size of <filename>. if you don't want
the size in k, M... use 'dh -s' instead of  'dh -sh' (btw 'h' means:
human readable).

Unsubscribe: send email to listar at
and put 'unsubscribe blfs-support' in the subject header of the message

More information about the blfs-support mailing list