ls -l?
Edit: oh, you only want to look at the .dat files. In that case, you'll probably want to just get sizes and add them up. One way to do it is:
total=0
for size in `ls -l *.dat | awk '{print $5}'`; do let total=$total+$size; done
echo $total
That will give you the total size in bytes. ls -l gives you the "long listing format" for the .dat files (which includes permissions, owners, sizes, etc) and then that is passed to awk to extract the sizes (which is column 5).
In future, please use thread titles that describe your question/problem.
Last edited by Nylex; 09-21-2010 at 12:55 AM.
|