APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed


© May 2005 Tony Lawrence

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


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


	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

But it's the other way around for _POSIX_LINK_MAX

# getconf _POSIX_LINK_MAX `pwd`
# 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.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> getconf

1 comment

Inexpensive and informative Apple related e-books:

Take Control of Pages

El Capitan: A Take Control Crash Course

Sierra: A Take Control Crash Course

Take Control of Apple Mail, Third Edition

iOS 8: A Take Control Crash Course

More Articles by © Tony Lawrence

Thu May 5 13:41:25 2005: 467   BigDumbDinosaur

Also see setconf, which you may use to set the value of a system variable.


Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

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)

Linux posts

Troubleshooting posts

This post tagged:



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode

SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)