nix, shell, perl, php, mysql and mac os x tips and tricks

Monday, October 20, 2003

Get the size of a file within a shell script

file_size=$(ls -l "path/file" | awk '{ print $5 }')
echo $file_size

No comments:

Post a Comment