NAME

qu - display quota usage statistics

SYNOPSIS

qu [--options] [directory ...]

DESCRIPTION

The qu utility displays the file system block usage for each directory in the file hierarchy rooted in each directory argument owned by the current process owner (or 'user' if specified). If no directory is specified, the block usage of the hierarchy rooted in the current directory usage is displayed. Usage is only calculated for files and directories owned by the process owner (i.e., you), making this useful for calculating real quota usage (hence qu).

You may view statistics for multiple, disjointed file hierarchies by specifying multiple directory arguments. You may also specify a variety of command-line arguments to alter the output of qu. See "OPTIONS".

If a path is prefixed with a leading slash ('/'), qu will assume you want to calculate disk space used relative to your home directory. If you want to calculate usage outside of your home directory, chdir to that directory and run qu. If you type this, regardless of your current working directory:

qu /usr/local/lib

qu will calculate disk space used in $HOME/usr/local/lib.

Paths not prefixed with a leading slash will be assumed relative to the current working directory. If your current working directory path is /usr/local, typing:

qu lib

will calculate space used by you in the real /usr/local/lib (i.e., not relative to your home directory).

qu may be run by root (UID 0) with the --user option to calculate quota usage for a particular user. Unless you are root, the --user option will not likely return anything useful unless the directories owned by the specified user are readable by your UID.

When run as root, qu uses absolute filesystem paths:

qu /

will calculate usage from the filesystem /, not root's home directory (which may or may not be /).

OPTIONS

A variety of useful options are available for qu, allowing you to customize how qu calculates its disk usage and how that information is displayed.

Options may be specified with a single dash or the recommended GNU-style double-dash for clarity. Options may be abbreviated to the fewest unique letters required to avoid ambiguity:

qu -bl 512 -by -c /usr/local

and:

qu --bl=512 --by --c /usr/local

are the same as:

qu --blocksize=512 --bytes --cumulative /usr/local

Pay attention that as new options are added to qu, more characters may be required to avoid ambiguity.

help

Show a brief help menu for qu and exit.

version

Display the version number of qu and exit.

verbose

Show far more information than you really want ;o). This is useful if you suspect that qu has a bug and want to be able to trace it somewhat. Seldom useful for the average user.

twiddle

Show the current block count and path during processing.

blocksize=n

Use n when calculating block sizes. The default value of n is 1024 bytes so that qu will match the output of the 'quota' system command. If you want 'du'-style 512 byte block reporting, set blocksize to 512.

bytes

Display total bytes used in the summary report. Because of the layout of the UNIX filesystem, actual disk usage is rounded up to the nearest block (512 bytes). So, for example, a file that is 513 bytes long will actually occupy two blocks of 512 bytes each or 1024 real bytes.

cumulative

Displays the total disk usage for each directory of all blocks rooted in that directory. This is the default 'du'-style usage.

levels=n

Show n levels of directories. Not specifying any number (or specifying 0) will show all directory levels. If the summary option is specified, no directory output will be displayed regardless of what levels is set to.

sort=sortoption

Sorts the resulting directory data. If the summary option is specified, no directory output will be displayed regardless of what sort is set to. Valid sort options follow.

alpha

Sort by directory alphanumerically

alpha_i

Like alpha but case-insensitive

alpha_reverse

Like alpha but reversed

alpha_reverse_i

Like alpha_reverse but case-insensitive

alpha_breadth

Sort by how "far" the directory is from the root, with the "closest" directories first in alphanumeric order

alpha_breadth_i

Like alpha_breadth but case-insensitive

blocks

Sort by block usage

blocks_reverse

Like blocks but reversed. This is a useful sort option ;o)

summary

Display only summary statistics; that is, do not show any directory information, just a terse disk usage statement for the specified directory (or directories).

user=user

Count files owned by user. By default, user is set to the owner of the process running qu.

EXAMPLES

Show brief statistics for the file hierarchy rooted in the current working directory

qu --summary

Show brief statistics for my home directory (should be close to 'quota -v' output)

qu --summary /

Show detailed statistics for two directory levels deep in my home directory (levels=2 is the default)

qu /

Show cumulative detailed statistics for three directory levels deep in my home directory

qu --levels=3 --cumulative /

qu -l 3 -c /

Show detailed statistics for ~/usr/local/lib

qu /usr/local/lib

Show detailed statistics for ~/usr/local/lib and sort the output based on which directories use the most blocks

qu --sort=blocks_reverse /usr/local/lib

Show detailed statistics for Bob's /usr/local/bin

qu --user=bob ~bob/usr/local/bin

AUTHOR

Scott Wiersdorf <scott@perlcode.org>

SEE ALSO

perl(1).