du
From NetBSD Wiki
du(1) displays the disk usage for the specified directories and each sub directoy. By default, du displays the number of blocks as returned by the stat(2) system call, i.e. 512-byte blocks. If the -k flag is specified, the number displayed is the number of kilobyte (1024 bytes) blocks. Partial numbers of blocks are rounded up. With the -h option, (only in NetBSD Version > 1.6) "Human-readable" output is shown, where a K suffix means this many kilobytes, an M suffix means megabytes, a G suffix means Gigabytes and a T suffix means Terabytes. If no directories are specified, the current directory is used.
The -s (summary) option can be used to hide the entries for the sub-directories. Only the specified directories are displayed.
Combined with sort, du can be used to find the most disk consuming directories below a certain path.
% cd /home % du -s *|sort -n 787 testuser 1721334 user1 1937310 user2
The Blocksize Variable
The blocksize Variable is set by default on the root account to 1k (1024 Bytes). If the blocksize environment Variable is set, du and df will display file sizes accordingly. That means, in general for root, du without options is the same as du -k.
If you want to check, if your blocksize Variable is set or not, enter "export" or "env" depending on your shell.
# env PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin TERM=vt100 LOGNAME=root USER=root HOME=/root SHELL=/bin/csh PWD=/root BLOCKSIZE=1k
