![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Block Size | Ruben78 | AIX | 3 | 04-28-2008 08:40 PM |
| block size | bache_gowda | UNIX for Dummies Questions & Answers | 1 | 05-31-2007 07:21 AM |
| How to know the OS Block size | Dilippatel | UNIX for Dummies Questions & Answers | 1 | 07-20-2004 07:23 AM |
| block size | csaunders | SUN Solaris | 3 | 05-19-2004 02:35 PM |
| os block size | kburrows | Filesystems, Disks and Memory | 1 | 10-10-2002 04:45 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
Hmm... this confusion is contagious - i'm not too sure I follow you at all!
![]() I assume from your previous posts you're still using Linux (and therefore GNU ls). I also will assume that you're trying to display file sizes in 512 byte blocks? If so, you don't need to do any calculation - if you run ls -Rls --block-size=512 you'll get a total block count at the top of each directories' listing - with each files size in 512-byte blocks in the first column of output, e.g. Code:
$ ls -Rls --block-size=512 .: total 16 12 -rw-r--r-- 1 zb foogroup 5265 Jan 2 22:34 index.html 4 -rw-r--r-- 1 zb foogroup 2043 Jan 10 14:52 submit_contact.php Code:
ls -Rls --block-size=512 | grep "^total" | awk 'BEGIN{c=0} {c+=$2} END{print c}'
ZB |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|