[Ilugc] Re: Need to calculate the file size in shell scripting

  • From: mohan43u@xxxxxxxxx (Mohan R)
  • Date: Tue Jan 5 09:23:31 2010

Balachandar wrote:

    i dont want any trailing attachments.I only want the file size.Any help 
??  

then, take whatever field you want like this,

$ du -s 1.txt | awk '{print $1;}'
100
$

or another one,

$ ls -l /bin/bash | awk '{print $5;}'
908464
$

Thanks,
Mohan R

Other related posts: