I recently learnt about a simple program named
getconf that can be used to query and view values of various system configuration variables. It is a POSIX program that ships with the GNU C Library (glibc) and so should be available on any Linux system. It can be used to query system variables and path variables from the shell.
- To view all the variables and values that this program handles:
$ getconf -a
- To query a specific variable:
$ getconf INT_MAX
- Some of the getconf variables that I find interesting:
- In case you are curious,
getconfjust calls the
sysconffunction provided by the GNU C Library. This can be seen in the
posix/getconf.csource file in glibc.
To get the cache details of an Intel 64-bit x86 CPU,
cpuidassembly instruction. This can be seen in the
sysdeps/x86_64/cacheinfo.csource file in glibc.
Tried with: GLibC 2.19 and Ubuntu 14.04