Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Name

nix ps - list active builds

Synopsis

nix ps [option…]

Examples

  • Show all active builds:

    # nix ps
    USER      PID         CPU        RSS  DERIVATION/COMMAND
    nixbld11  3534394  110.2s  438.6 MiB  /nix/store/lzvdxlbr6xjd9w8py4nd2y2nnqb9gz7p-nix-util-tests-3.13.2.drv (wall=8s)
    nixbld11  3534394    0.8s    3.9 MiB  └───bash -e /nix/store/jwqf79v5p51x9mv8vx20fv9mzm2x7kig-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k
    nixbld11  3534751   36.3s    7.5 MiB      └───ninja -j24
    nixbld11  3535637    0.0s    4.1 MiB          ├───/nix/store/0v2jfvx71l1zn14l97pznvbqnhiq3pyd-gcc-14.3.0/bin/g++ -fPIC -fstack-clash-protect
    nixbld11  3535639    0.1s  412.3 MiB          │   └───/nix/store/0v2jfvx71l1zn14l97pznvbqnhiq3pyd-gcc-14.3.0/libexec/gcc/x86_64-unknown-linu
    nixbld11  3535658    0.0s    4.0 MiB          └───/nix/store/0v2jfvx71l1zn14l97pznvbqnhiq3pyd-gcc-14.3.0/bin/g++ -fPIC -fstack-clash-protect
    nixbld1   3534377    1.8s   16.2 MiB  /nix/store/nh2dx9cqcy9lw4d4rvd0dbsflwdsbzdy-patchelf-0.18.0.drv (wall=5s)
    nixbld1   3534377    1.8s    4.2 MiB  └───bash -e /nix/store/xk05lkk4ij6pc7anhdbr81appiqbcb01-default-builder.sh
    nixbld1   3535074    0.0s    3.8 MiB      └───/nix/store/21ymxxap3y8hb9ijcfah8ani9cjpv8m6-bash-5.2p37/bin/bash ./configure --disable-depende
    

Description

This command lists all currently running Nix builds. For each build, it shows the derivation path and the main process ID. On Linux and macOS, it also shows the child processes of each build.

The CPU column shows the CPU time used, and the RSS column shows the resident memory (resident set size). For a build, the memory is taken from the build’s cgroup if available (on Linux with cgroups enabled). Otherwise it’s the sum of the memory of its processes, which overestimates memory usage because memory shared between processes is counted multiple times.

Options

  • --json

    Produce output in JSON format, suitable for consumption by another program.

  • --no-pretty

    Print compact JSON output on a single line, even when the output is a terminal. Some commands may print multiple JSON objects on separate lines.

                  See `--pretty`.
    
  • --pretty

    Print multi-line, indented JSON output for readability.

                  Default: indent if output is to a terminal.
    
                  This option is only effective when `--json` is also specified.
    
  • --debug

    Set the logging verbosity level to ‘debug’.

  • --log-format format

    Set the format of log output; one of raw, internal-json, bar or bar-with-logs.

  • --print-build-logs / -L

    Print full build logs on standard error.

  • --quiet

    Decrease the logging verbosity level.

  • --verbose / -v

    Increase the logging verbosity level.

Miscellaneous global options

  • --help

    Show usage information.

  • --offline

    Disable substituters and consider all previously downloaded files up-to-date.

  • --option name value

    Set the Nix configuration setting name to value (overriding nix.conf).

  • --refresh

    Consider all previously downloaded files out-of-date.

  • --version

    Show version information.

Note

See man nix.conf for overriding configuration settings with command line flags.