Sponsored Content
Full Discussion: du
Top Forums UNIX for Dummies Questions & Answers du Post 6106 by andrec on Wednesday 29th of August 2001 07:40:38 PM
Old 08-29-2001
Question du

I have a question about the use of du. I understand that du reports the number of 512-byte blocks of disk usage used in the directory and below.

However, with only 3 small files (file a is 64 bytes; b is 68 bytes; c is 6 bytes), du seems to tell me that the OS is using 8 blocks x 512-byte to store them. Is there anything wrong with my calculations or I misunderstand anything?

When I do a 'du' with no option, it gives me:
8 .
When I do a 'du -k', it gives me:
4 .
When I do a 'du -a' , it gives me:
2 ./a
2 ./b
2 ./c
8 .



 
DD(1)							      General Commands Manual							     DD(1)

NAME
dd - disk dumper SYNOPSIS
dd [option = value] ... EXAMPLES
dd if=/dev/fd0 of=/dev/fd1 # Copy disk 0 to disk 1 dd if=x of=y bs=1w skip=4 # Copy x to y, skipping 4 words dd if=x of=y count=3 # Copy three 512-byte blocks DESCRIPTION
This command is intended for copying partial files. The block size, skip count, and number of blocks to copy can be specified. The options are: if = file - Input file (default is stdin) of = file - Output file (default is standard output) ibs = n - Input block size (default 512 bytes) obs = n - Output block size (default is 512 bytes) bs = n - Block size; sets ibs and obs (default is 512 bytes) skip = n - Skip n input blocks before reading seek = n - Skip n output blocks before writing count = n - Copy only n input blocks conv = lcase - Convert upper case letters to lower case conv = ucase - Convert lower case letters to upper case conv = swab - Swap every pair of bytes conv = noerror- Ignore errors and just keep going conv = silent- Suppress statistics (Minix specific flag) Where sizes are expected, they are in bytes. However, the letters w, b, or k may be appended to the number to indicate words (2 bytes), blocks (512 bytes), or K (1024 bytes), respectively. When dd is finished, it reports the number of full and partial blocks read and writ- ten. SEE ALSO
vol(1). DD(1)
All times are GMT -4. The time now is 12:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy