"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 A system configuration variable, as defined by sysconf(3) or confstr(3). path_var A system configuration variable as defined by pathconf(3). This 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. (No longer true). 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.
On systems that have "-a", of course you'd use "getconf -a | grep MAX"
Got something to add? Send me email.
More Articles by Tony Lawrence © 2012-07-17 Tony Lawrence
What do such machines really do? They increase the number of things we can do without thinking. Things we do without thinking — there's the real danger. (Frank Herbert)