one query
hi friends i have one question
there is one folder having .dat &.txt files .i have to find the size of total .dat files in that folder .please suggest me how can i find this |
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. |
Looks like homework to me??
|
du -chs *.dat
|
its not working in unix.plz tell me the command which can work in unix
|
Which Unix OS you are using ?
|
du (abbreviated from disk usage) is a standard Unix program used to estimate the file space usage—space used under a particular directory or files on a file system.
Refer this link http://en.wikipedia.org/wiki/Du_%28Unix%29 |
All times are GMT -5. The time now is 10:16 PM. |