OS Manuals

/usr/bin/ccache

Fast C/C++ compiler cache

From ccache 4.14.3-r0 (os), captured 2026-11-09 by running ccache --help (exit 0). permalink

Usage:
    ccache [ccache options]
    ccache [KEY=VALUE ...] compiler [compiler options]
    compiler [compiler options]

    The first form takes options described below. The second form invokes the
    compiler, optionally using configuration options from KEY=VALUE arguments.
    In the third form, ccache is masquerading as the compiler.

Common options:
    -c, --cleanup              delete not recently used files and recalculate
                               size counters (normally not needed as this is
                               done automatically)
    -C, --clear                clear the cache completely (except configuration)
        --config-path PATH     operate on configuration file PATH instead of the
                               default
    -d, --dir PATH             operate on cache directory PATH instead of the
                               default
        --dry-run              do not perform any write operations
        --evict-namespace NAMESPACE
                               remove files created in namespace NAMESPACE
        --evict-older-than AGE remove files used less recently than AGE
                               (unsigned integer with a d (days) or s (seconds)
                               suffix)
    -F, --max-files NUM        set maximum number of files in cache to NUM (use
                               0 for no limit)
    -M, --max-size SIZE        set maximum size of cache to SIZE (use 0 for no
                               limit); available suffixes: kB, MB, GB, TB
                               (decimal) and KiB, MiB, GiB, TiB (binary);
                               default suffix: GiB
    -X, --recompress LEVEL     recompress the cache to level LEVEL (integer or
                               "uncompressed")
    -o, --set-config KEY=VALUE set configuration option KEY to value VALUE in the
                               configuration file
    -x, --show-compression     show compression statistics
    -p, --show-config          show current configuration options in
                               human-readable format
        --show-log-stats       print statistics counters from the stats log
                               in human-readable format
    -s, --show-stats           show summary of configuration and statistics
                               counters in human-readable format (use
                               -v/--verbose once or twice for more details)
        --threads THREADS      use up to THREADS threads for threaded operations;
                               default: number of CPUs
    -v, --verbose              increase verbosity
    -z, --zero-stats           zero statistics counters

    -h, --help                 print this help text
    -V, --version              print version and copyright information

Options for remote file-based storage:
        --trim-dir PATH        remove not recently used files from directory
                               PATH until it is at most the size specified by
                               --trim-max-size (note: don't use this option to
                               trim the local cache)
        --trim-max-size SIZE   specify the maximum size for --trim-dir (use 0 for
                               no limit); available suffixes: kB, MB, GB, TB
                               (decimal) and KiB, MiB, GiB, TiB (binary);
                               default suffix: GiB
        --trim-method METHOD   specify the method (atime or mtime) for
                               --trim-dir; default: atime
        --trim-recompress LEVEL
                               recompress to level LEVEL (integer or
                               "uncompressed")

Options for scripting or debugging:
        --checksum-file PATH   print the checksum (128 bit XXH3) of the file at
                               PATH
        --extract-result PATH  extract file data stored in result file at PATH
                               to the current working directory
        --format FORMAT        specify format for --print-log-stats and
                               --print-stats (tab, json); default: tab
    -k, --get-config KEY       print the value of configuration key KEY
        --hash-file PATH       print the hash (160 bit BLAKE3) of the file at
                               PATH
        --inspect PATH         print result/manifest file at PATH in
                               human-readable format
        --stop-storage-helpers stop running storage helper(s), if any
        --print-log-stats      print statistics counter IDs and corresponding
                               values from the stats log in machine-parsable
                               format
        --print-stats          print statistics counter IDs and corresponding
                               values in machine-parsable format
        --print-version        print version only

See also the manual on <https://ccache.dev/documentation.html>.
Options (34)
OptionDescriptionSource
-c, --cleanupClean up the cache by removing not recently used cached files until the specified file number and cache size limits are not exceeded.help + man
-C, --clearClear the entire cache, removing all cached files, but keeping the configuration file.help + man
--config-path PATHLet the command line options operate on configuration file PATH instead of the default.help + man
-d, --dir PATHLet the command line options operate on cache directory PATH instead of the default.help + man
--dry-runDo not perform any write operations.help + man
--evict-namespace NAMESPACERemove files created in the given namespace from the cache.help + man
-F, --max-files NUMset maximum number of files in cache to NUM (use 0 for no limit)help + man
-M, --max-size SIZEset maximum size of cache to SIZE (use 0 for no limit);help + man
-X, --recompress LEVELRecompress the cache to level LEVEL using the Zstandard algorithm.help + man
-x, --show-compressionPrint cache compression statistics.help + man
-p, --show-configPrint current configuration options and from where they originate (environment variable, configuration file or compile-time default) in human-readable format.help + man
--show-log-statsPrint statistics counters from the stats log in human-readable format.help + man
-s, --show-statsshow summary of configuration and statistics counters in human-readable format (usehelp + man
--threads THREADSuse up to THREADS threads for threaded operations;help + man
-v, --verboseIncrease verbosity.help + man
-z, --zero-statsZero the cache statistics (but not the configuration options).help + man
-h, --helpPrint a summary of command line options.help + man
-V, --versionPrint version and copyright information.help + man
--trim-dir PATHRemove not recently used files from directory PATH until it is at most the size specified by --trim-max-size.help + man
--trim-max-size SIZEspecify the maximum size for --trim-dir (use 0 for no limit);help + man
--trim-method METHODSpecify the method to trim a directory with --trim-dir.help + man
--trim-recompress LEVELRecompress to level LEVEL using the Zstandard algorithm when using --trim-dir.help + man
--checksum-file PATHPrint the checksum (128 bit XXH3) of the file at PATH (- for standard input).help + man
--extract-result PATHextract file data stored in result file at PATH to the current working directoryhelp + man
--format FORMATSpecify format for --print-log-stats and --print-stats.help + man
-k, --get-config KEYPrint the value of configuration option KEY.help + man
--hash-file PATHPrint the hash (160 bit BLAKE3) of the file at PATH (- for standard input).help + man
--inspect PATHPrint the content of a result or manifest file at PATH (- for standard input) to standard output in human-readable format.help + man
--print-log-statsprint statistics counter IDs and corresponding values from the stats log in machine-parsable formathelp + man
--print-statsPrint statistics counter IDs and corresponding values in machine-parsable (tab-separated or JSON) format.help + man
--print-versionPrint version and don’t do anything else.help + man
--evict-older-than AGERemove files used less recently than AGE from the cache. (in the manual page but not in --help)man
-o, --set-config KEY=VALUESet configuration option KEY to VALUE in the configuration file. (in the manual page but not in --help)man
--stop-storage-helpersStorage helpers normally stop after a period of client inactivity, but this option can be used to stop any running helpers immediately. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.