← 返回命令列表

Linux command

fc-cache 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Rebuild font cache

fc-cache

Force rebuild

fc-cache -fv

Rebuild system-wide caches

sudo fc-cache -fvs

Rebuild cache

fc-cache [path/to/fonts/directory]

Erase all caches

fc-cache -r

Check if cache files

fc-cache -rv

说明

fc-cache scans font directories and builds font information cache files for applications using fontconfig. These caches map font file names to font properties, enabling fast font lookup at application startup without scanning all font files. If no directory arguments are given, fc-cache processes all directories in the current fontconfig configuration. Each directory is scanned for font files readable by FreeType, and cache files are created containing font properties and associated filenames. User caches are stored in ~/.cache/fontconfig/ while system caches are stored in /var/cache/fontconfig/. Cache files must be regenerated when fonts are added or removed.

参数

-f, --force
Force re-generation of cache files, overriding timestamp checking.
-r, --really-force
Erase all existing cache files and rescan.
-s, --system-only
Only scan system-wide directories, omitting user home directory locations.
-v, --verbose
Display status information while processing.
-E, --error-on-no-fonts
Raise an error if there are no fonts in the specified directory.
-V, --version
Display fontconfig version and exit.
-h, --help
Display help message and exit.

FAQ

What is the fc-cache command used for?

fc-cache scans font directories and builds font information cache files for applications using fontconfig. These caches map font file names to font properties, enabling fast font lookup at application startup without scanning all font files. If no directory arguments are given, fc-cache processes all directories in the current fontconfig configuration. Each directory is scanned for font files readable by FreeType, and cache files are created containing font properties and associated filenames. User caches are stored in ~/.cache/fontconfig/ while system caches are stored in /var/cache/fontconfig/. Cache files must be regenerated when fonts are added or removed.

How do I run a basic fc-cache example?

Run `fc-cache` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f, --force do in fc-cache?

Force re-generation of cache files, overriding timestamp checking.