how to know size of a file

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


On Tue, 1 Jul 2003 01:12:23 -0700 (PDT)
layman <layman82 at yahoo.com> 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).

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



More information about the blfs-support mailing list