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

  • From: sureshkumar.s@xxxxxxxxxx (Suresh Kumar Subramanian)
  • Date: Tue Jan 5 09:37:46 2010

$ du -s 1.txt | awk '{print $1;}'
100
$
or another one,
$ ls -l /bin/bash | awk '{print $5;}'
908464
$
Nice answer.
Thanks
Suresh

Other related posts: