Sunday, October 6, 2024

getconf

“getconf” returns the value of certain system variables. According to the man page (which you may not have on your system) it queries system configuration variables which are either:

system_var

&nbsp&nbsp&nbsp&nbsp A system configuration variable, as defined by sysconf(3) or
&nbsp&nbsp&nbsp&nbsp confstr(3).

path_var

&nbsp&nbsp&nbsp&nbsp A system configuration variable as defined by pathconf(3). This
&nbsp&nbsp&nbsp&nbsp must be used with a pathname.

Unlike some implementations, the Linux version won’t spit out all the variables it knows about with a “-a” or whatever. You have to either know what you want to know more about, or visit the other man pages (sysconf, confstr, pathconf) to discover your choices.

Not all that you’ll find in the man pages will work though, and there seems to be a cavalier attitude toward the importance of leading underscores. For example, “man confstr” tells us about _CS_PATH, which tells us where to look for POSIX utilities. So we ask “getconf”:

# getconf _CS_PATH
getconf: Unrecognized variable `_CS_PATH'
# getconf CS_PATH
/bin:/usr/bin
But it's the other way around for _POSIX_LINK_MAX

# getconf _POSIX_LINK_MAX `pwd`
32000
# getconf POSIX_LINK_MAX `pwd`
getconf: Unrecognized variable `POSIX_LINK_MAX'

A “strings” of “getconf” reveals a lot of things with leading underscores, and a lot without. No doubt this all makes perfect sense to the author or kernel programmers who are probably more intimate with these variables than I. A strings that is then passed to “grep MAX” reveals a few candidates you might find useful now and then.

*Originally published at APLawrence.com

A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

Wider crypto market trends. Obsessive compulsive personality disorder (ocpd).