Linux command
expac 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Example
expac [-S|--sync] '%D' [package]
Example
expac [-S|--sync] "%o" [package]
Example
expac [-S|--sync] [-H|--humansize] M '%k\t%n' [package1] [package2]
Example
expac [-S|--sync] [-H|--humansize] M '%k\t%n' $(pacman -Qqu) | sort [-sh|--sort --human-numeric-sort]
Example
expac [-d|--delim] '\n\n' [-l|--listdelim] '\n\t' [-Q|--query] '%n\n\t%O' $(pacman -Qeq)
说明
expac extracts data from alpm databases using printf-like format strings. It provides flexible output formatting for pacman-based package queries. The tool acts as a lightweight alternative to parsing pacman output, offering direct access to package metadata including dependencies, sizes, descriptions, and installation dates. Format specifiers like %n (name), %v (version), %D (dependencies) enable custom reports. Useful for scripting, package analysis, and generating custom package reports. Particularly powerful when combined with other tools for filtering and processing package information.
参数
- -S, --sync
- Query sync database
- -Q, --query
- Query local database
- -H, --humansize _unit_
- Human-readable sizes (K, M, G)
- -d, --delim _string_
- Delimiter between packages (default: newline)
- -l, --listdelim _string_
- Delimiter for list items (default: two spaces)
- -t, --timefmt _format_
- Time output format string passed to strftime(3) (default: %c)
- -1, --readone
- Stop after first match
- -p, --file _pkgfile_
- Query a package file instead of the database
FAQ
What is the expac command used for?
expac extracts data from alpm databases using printf-like format strings. It provides flexible output formatting for pacman-based package queries. The tool acts as a lightweight alternative to parsing pacman output, offering direct access to package metadata including dependencies, sizes, descriptions, and installation dates. Format specifiers like %n (name), %v (version), %D (dependencies) enable custom reports. Useful for scripting, package analysis, and generating custom package reports. Particularly powerful when combined with other tools for filtering and processing package information.
How do I run a basic expac example?
Run `expac [-S|--sync] '%D' [package]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -S, --sync do in expac?
Query sync database