Sponsored Content
Full Discussion: block size and du output
Top Forums Shell Programming and Scripting block size and du output Post 60134 by moxxx68 on Tuesday 11th of January 2005 07:07:31 AM
Old 01-11-2005
block size and du output

i wrote this code to figure if two identical directories on different devices one on a partition and one on a loop had the same total size for -size +0 file only in recrusive tree form.:
awk '$1 ~ /^-/{total=i;i<=NR;i+=$5;print $0}END{print total}'
file1.... .
the output of du -hb was slightly different, but the total of files was the same.. so I tried to figure out the total of the bytes in blocks (?).. (correct me if I am wrong!).
i used bc and took the size of the number of blocks the file added up to which was 21 and multiplied it by (512*512) and devided by 2 what is this output? it looks similiar to the number I got through du but with a couple of digits on the end! is this the size in byts? two byt words? or am i supposed to devide by 8..
{quite confused) moxxx68...
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

block size

Hi, Somehow i have forgotten a comand that displays me the block size of the unix filesystem. Can someone letme know this command regards penguin (5 Replies)
Discussion started by: linuxpenguin
5 Replies

2. Filesystems, Disks and Memory

os block size

AIX 4.3.3 How can I find the os block size? How can I change the OS Block Size? When and where does the os block size get set? I am running oracle 8.1.7 and am under the impression I need to set my os block size = oracle block size which is 8k. Any insight on this would be... (1 Reply)
Discussion started by: kburrows
1 Replies

3. Solaris

block size

how do you determine block size for a file system? In solaris 5.8 (3 Replies)
Discussion started by: csaunders
3 Replies

4. UNIX for Dummies Questions & Answers

How to know the OS Block size

Hello Unix guru's I want to check my OS Block size for the Solaris 8 Following is one of the line from df -g command. Can anybody help to interpret the same. /u03 (/dev/vx/dsk/oradg/vol03): 8192 block size 8192 frag size 205463552 total blocks 50433792... (1 Reply)
Discussion started by: Dilippatel
1 Replies

5. UNIX for Dummies Questions & Answers

block size

Hi All, drwxr-xr-x 2 root root 4096 May 31 14:47 test Please let me know here 4096 indicating what? Thanks & Regards, Bache (1 Reply)
Discussion started by: bache_gowda
1 Replies

6. Shell Programming and Scripting

how to make a line BLINKING in output and also how to increase font size in output

how to make a line BLINKING in output and also how to increase font size in output suppose in run a.sh script inside echo "hello world " i want that this should blink in the output and also the font size of hello world should be big .. could you please help me out in this (3 Replies)
Discussion started by: mail2sant
3 Replies

7. AIX

Block Size

Hi, I try to change the block size from 512 to 0, but it send this message: 0514-068 Cause not know Can someone help me whith this? (3 Replies)
Discussion started by: Ruben78
3 Replies

8. UNIX for Advanced & Expert Users

Physical disk IO size smaller than fragment block filesystem size ?

Hello, in one default UFS filesystem we have 8K block size (bsize) and 1K fragmentsize (fsize). At this scenary I thought all "FileSytem IO" will be 8K (or greater) but never smaller than the fragment size (1K). If a UFS fragment/blocksize is allwasy several ADJACENTS sectors on disk (in a ... (4 Replies)
Discussion started by: rarino2
4 Replies

9. Red Hat

O/s block size

Hi Guys, I am running Linux 2.6.18-164.el x86_64 how do i check the block size? Thanks in advance... (1 Reply)
Discussion started by: Phuti
1 Replies

10. HP-UX

About Block Size and Fragment Size

Accordingly a lot of manuals - if you have block size 8KB and trying to write a 1KB file to the block, as result you waste 7KB of the block space. But recently I noticed about Fragments of File Block. In same case if you have File Block 8KB and Fragment size 1KB - you can save your block space,... (6 Replies)
Discussion started by: jess_t03
6 Replies
KVM_SWAPINFO(3) 					   BSD Library Functions Manual 					   KVM_SWAPINFO(3)

NAME
kvm_getswapinfo -- return swap summary statistics for the system LIBRARY
Kernel Data Access Library (libkvm, -lkvm) SYNOPSIS
#include <kvm.h> int kvm_getswapinfo(kvm_t *kd, struct kvm_swap *, int maxswap, int flags); DESCRIPTION
The kvm_getswapinfo() function fills an array of kvm_swap structures with swap summary information for each swap device, for up to maxswap - 1 devices. The number of devices, up to maxswap - 1, is returned. A grand total of all swap devices (including any devices that go beyond maxswap - 1) is returned in one additional array entry. This entry is not counted in the return value. Thus, if you specify a maxswap value of 1, the function will typically return the value 0 and the single kvm_swap structure will be filled with the grand total over all swap devices. The grand total is calculated from all available swap devices whether or not you made room for them all in the array. The grand total is returned. The flags argument is currently unused and must be passed as 0. If an error occurs, -1 is returned. Each swap partition and the grand total is summarized in the kvm_swap structure. This structure contains the following fields: char ksw_devname[]; int ksw_total; int ksw_used; int ksw_flags; Values are in PAGE_SIZE'd chunks (see getpagesize(3)). ksw_flags contains a copy of the swap device flags. CACHING
This function caches the nlist values for various kernel variables which it reuses in successive calls. You may call the function with kd == NULL to clear the cache. DIAGNOSTICS
If the load average was unobtainable, -1 is returned; otherwise, the number of swap devices actually retrieved is returned. If the name of the swap device does not fit in the static char buffer in the structure, it is truncated. The buffer is always zero termi- nated. SEE ALSO
kvm(3) BSD
January 22, 1999 BSD
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy