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: 961 | 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:


[2016-12-25][Open System-Linux]
Guide for working with zipped and archived files in Linux/AIX
[2014-03-13][Open System-Linux]
crontab: A command in linux to automatically start/repeat a process at certian time and interval
[2014-10-26][Open System-Linux]
XMLLINT command in linux : a validating XML parser
[2014-10-24][Open System-Linux]
HEXDUMP command in Linux to display the file content in decimal, hexadecimal, octal format
[2014-04-24][Open System-Linux]
Addition of two numbers using shell scripting in UNIX

Total comments: 0
avatar