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: 1421 | 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-02-27][Open System-Linux]
RSYNC : A command in linux to copy files remotely. Faster and more flexible than rcp
[2015-03-23][Open System-Linux]
FSCK : Checking and reparing filesystems in Linux
[2016-01-23][Open System-Linux]
Some useful examples of netstat command in Linux for network statistics
[2015-06-01][Open System-Linux]
DIG command : A DNS lookup utility
[2014-12-03][Open System-Linux]
GREP command in Linux to search for a pattern

Total comments: 0
ComForm">
avatar