← 返回命令列表

Linux command

facter 命令

文本

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

常用示例

Show all facts

facter

Show specific fact

facter [os.family]

Show facts in JSON

facter --json

Show facts in YAML

facter --yaml

List all fact names

facter --list

Show timing information

facter --timing

Debug output

facter --debug

说明

facter collects and displays system facts - information about the operating system, hardware, network, and other system properties. It's a core component of Puppet, providing data for configuration management. Facts include OS details, IP addresses, memory, processors, disk space, and more. Custom facts can be written in Ruby or as executable external facts.

参数

--json
Output in JSON format.
--yaml
Output in YAML format.
--list
List all fact names.
--timing
Show timing for each fact.
--debug
Debug output.
--no-custom-facts
Disable custom facts.
--external-dir _dir_
Directory for external facts.
--puppet
Load Puppet's settings.
-p
Include Puppet facts.

FAQ

What is the facter command used for?

facter collects and displays system facts - information about the operating system, hardware, network, and other system properties. It's a core component of Puppet, providing data for configuration management. Facts include OS details, IP addresses, memory, processors, disk space, and more. Custom facts can be written in Ruby or as executable external facts.

How do I run a basic facter example?

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

What does --json do in facter?

Output in JSON format.