Home » 2016 » May » 24 » FACTER command in Linux : showing system facts

7:25 PM
FACTER command in Linux : showing system facts

Facter - Collect and display facts/information about the system like uptime, OS info, memory usage, PATH, processor, n/w etc.

FORMAT
       facter [-d|--debug] [-h|--help] [-p|--puppet] [-v|--version] [-y|--yaml] [-j|--json] [fact] [fact] [...]

DESCRIPTION
       Collect  and  display  facts about the current system. The library behind Facter is easy to expand, making Facter an easy way to collect information about a system from within the shell or within Ruby.


OPTIONS
       
puppet:  Load the Puppet libraries, thus allowing Facter to load Puppet specific (custom) facts

       version: Print the version and exit.

       help:    Print this help message.

       debug:   Enable debugging.

       trace:   Enable backtraces.

       timing:  Enable timing.


EXAMPLE
       facter kernel

shankys:~> facter kernel
Linux

   If no facts are specifically asked for, then all facts of the system will be printed.

shankys:~> facter|head -n 20
architecture => x86_64
domain =>portal.com
facterversion => 1.6.18
fqdn => shankys.portal.com
hardwareisa => x86_64
hardwaremodel => x86_64
hostname => shankys

id => shankar
interfaces => eth0,lo
ipaddress => 160.46.142.114
ipaddress_eth0 => 160.46.142.114
ipaddress_lo => 127.0.0.1
is_virtual => true
kernel => Linux
kernelmajversion => 3.0
kernelrelease => 3.0.101-0.47.71-xen
kernelversion => 3.0.101
macaddress => 00:16:3E:2E:8E:72
macaddress_eth0 => 00:16:3E:2E:8E:72
memoryfree => 10.44 GB

We can specify a fact also and facter will return the info for that fact. For example if we want to know the uptime of the system,

shankys:~> facter uptime
20 days


You can use grep on top of facter to fetch any system information. Its really helpful to get any information about a system. Example:

 

shankys:~> facter|grep memory
memoryfree => 10.34 GB
memorysize => 16.01 GB
memorytotal => 16.01 GB

 
 

Category: Open System-Linux | Views: 1570 | Added by: shanky | Tags: facter, system information, system facts, facter command in Linux | Rating: 5.0/1

Related blogs


You may also like to see:


[2014-11-07][Open System-Linux]
FIND utility in Linux to search for files or directories.
[2015-09-09][Open System-Linux]
Some funny and cool commands in Linux
[2015-03-18][Open System-Linux]
What is runlevel in Linux?
[2015-01-12][Open System-Linux]
W3M : A text based web browser and pager from Linux terminal
[2016-05-11][Open System-Linux]
An example to understand bash exit code $? in linux.

Total comments: 0
ComForm">
avatar