// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
port-space(1)
=============

NAME
----
port-space - Show the disk usage of the given ports

SYNOPSIS
--------
[cmdsynopsis]
*port* [*-D* 'portdir'] *space* [--units 'unit'] ['total']
    [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]

DESCRIPTION
-----------
*port space* lists the amount of disk space the port(s) given on the command
line occupy on disk. Note that the space reported is for the files installed by
a port, but not the image of the port's files MacPorts keeps internally. See the
*PORT IMAGES* section for more information on how images work. Consequently,
*port space* will only work on active ports.

By default, *port space* will print a line with the size in an appropriate unit
followed by the name of a port for each port given on the command line (or
expanded from a pseudo-port expression given; see man:port[1] for more info on
pseudo-port expressions). The last line of output will contain a total.

If you are only interested in the total of all ports (e.g. if you want to get
the total amount of space used by your installed ports) use the *--total* flag.
If you want to sort the output by file size, you can pipe the results of *port
space* to *sort -n*. Since *port space* defaults to using a suitable unit, you
should specify a unit to allow for meaningful numeric sorting, e.g. *port space
--units KiB* to get all output in KiB.

OPTIONS
-------
*--total**::
    Only print the total amount of space used by all given ports.

*--units 'unit'*::
    Choose the unit in which the size is given. You should specify this if you
    intend to sort the output. Valid values for 'unit' are

    *B*:::
        List sizes in bytes.

    *K*, *Ki*, *KiB*:::
        List sizes in KiB, i.e., 1024 bytes.

    *Mi*, *MiB*:::
        List sizes in MiB, i.e., 1024 * 1024 bytes.

    *Gi*, *GiB*:::
        List sizes in GiB, i.e., 1024 * 1024 * 1024 bytes.

    *k*, *kB*:::
        List sizes in kB, i.e., 1000 bytes.

    *M*, *MB*:::
        List sizes in MB, i.e., 1000 * 1000 bytes.

    *G*, *GB*:::
        List sizes in GB, i.e., 1000 * 1000 * 1000 bytes.


include::global-flags.txt[]

include::archives.txt[]

EXAMPLES
--------
To find the 10 largest ports in your MacPorts installation, you can use the
following command:
----
$> port space --units MiB active | sort -rn | head -n10
----

SEE ALSO
--------
man:port[1], man:port-archive[1], man:sort[1]

AUTHORS
-------
 (C) 2015 The MacPorts Project
 Clemens Lang <cal@macports.org>
