getconf — Get configuration values

Format

  • getconf –a
  • getconf system_var
  • getconf [–a] path_var pathname

Description

getconf writes the value of a configuration variable to the standard output (stdout). You can specify the configuration variable using one of forms listed in the Format section. If you use the first form, getconf writes the value of the variable system_var. If you use the second form, getconf writes the value of the variable path_var for the path name given by pathname. The –a option prompts getconf to display all current configuration variables, and their values, to stdout.

getconf writes numeric values in decimal format and nonnumeric values as simple strings. If the value is not defined, getconf writes the string undefined to stdout.

Options

–a
Writes out all the configuration variables for the current system, and their values, to stdout. Path variables are written based on a path name of dot (.).

Configuration variables

You can use the second form of getconf to find the value of the following POSIX.1-1990 standard configuration variables for the specified path name:
LINK_MAX
Specifies the maximum number of links that this file can have.
MAX_CANON
Specifies the maximum number of bytes in the workstation's canonical input queue (before line editing).
MAX_INPUT
Specifies the space available in the workstation's input queue.
NAME_MAX
Specifies the largest filename size.
PATH
Specifies the standard PATH setting.
_CS_PATH
Specifies the standard PATH setting.
PATH_MAX
Specifies the maximum number of bytes in a path name.
PIPE_BUF
Specifies the largest atomic write to a pipe.
_POSIX_CHOWN_RESTRICTED
Specifies the restrictions that apply to file ownership changes.
_POSIX_NO_TRUNC
If set, it is an error for any path name component to be longer than NAME_MAX bytes.
_POSIX_VDISABLE
Specifies that processes are allowed to disable ending special characters.
You can use the first form of getconf to find the value of the following POSIX.1-1990 standard configuration variables:
ARG_MAX
Specifies the maximum length of arguments for running a program, including environment data.
CHILD_MAX
Specifies the maximum number of simultaneous processes allowed per real user.
CLK_TCK
Specifies the number of intervals per second in the machine clock.
NGROUPS_MAX
Specifies the number of simultaneous group IDs per process.
OPEN_MAX
Specifies the maximum number of open files at any time per process.
STREAM_MAX
Specifies the number of streams that one process can have open at one time.
TZNAME_MAX
Specifies the maximum number of bytes supported for the name of a time zone (not of the TZ variable).
_POSIX_ARG_MAX
Specifies the minimum conforming value for ARG_MAX.
_POSIX_CHILD_MAX
Specifies the minimum conforming value for CHILD_MAX.
_POSIX_JOB_CONTROL
Specifies the POSIX job control supported.
_POSIX_LINK_MAX
Specifies the minimum conforming value for LINK_MAX.
_POSIX_MAX_CANON
Specifies the minimum conforming value for MAX_CANON.
_POSIX_MAX_INPUT
Specifies the minimum conforming value for MAX_INPUT.
_POSIX_NAME_MAX
Specifies the minimum conforming value for NAME_MAX.
_POSIX_NGROUPS_MAX
Specifies the minimum conforming value for NGROUPS_MAX.
_POSIX_OPEN_MAX
Specifies the minimum conforming value for OPEN_MAX.
_POSIX_PATH_MAX
Specifies the minimum conforming value for PATH_MAX.
_POSIX_PIPE_BUF
Specifies the minimum conforming value for PIPE_BUF.
_POSIX_SAVED_IDS
Specifies that processes have saved set-user-ID and saved set-group-ID bits set.
_POSIX_SSIZE_MAX
Specifies the value that can be stored in an object of type ssize_t.
_POSIX_STREAM_MAX
Specifies the minimum conforming value for STREAM_MAX.
_POSIX_TZNAME_MAX
Specifies the minimum conforming value for TZNAME_MAX.
_POSIX_VERSION
Specifies the version of POSIX adhered to in this release.
You can use the first form of getconf to find the value of the POSIX.2 standard configuration variables:
BC_BASE_MAX
Specifies the maximum ibase and obase values for the bc command.
BC_DIM_MAX
Specifies the maximum number of elements permitted in a bc array.
BC_SCALE_MAX
Specifies the maximum scale size allowed in bc.
BC_STRING_MAX
Specifies the maximum number of characters in a string in bc.
COLL_WEIGHTS_MAX
Specifies the maximum number of weights assignable to an entry of the LC_COLLATE order keyword.
EXPR_NEST_MAX
Specifies the maximum number of expressions that you can nest inside parentheses in an expression evaluated by expr.
LINE_MAX
Specifies the maximum number of bytes that a utility can accept as an input line (either from the standard input or a text file) when the utility takes text files as input. This number includes the trailing <newline>.
RE_DUP_MAX
Specifies the maximum number of repeated occurrences of a regular expression when using the interval notation \{m,n\}.

See Regular expressions (regexp) for more information.

POSIX2_C_BIND
Indicates if the system supports the C Language Bindings Option.
POSIX2_C_DEV
Indicates if the system supports the C Language Development Utilities Option.
POSIX2_FORT_DEV
Indicates if the system supports the FORTRAN Development Utilities Option.
POSIX2_FORT_RUN
Indicates if the system supports the FORTRAN Runtime Utilities Option.
POSIX2_LOCALEDEF
Indicates if the system supports the creation of locales.
POSIX2_SW_DEV
Indicates if the system supports the Software Development Utilities Option.
POSIX2_CHAR_TERM
Indicates if the system supports at least one terminal type capable of all operations necessary for the User Portability Utilities Option. This parameter name is correct only on if POSIX2_UPE is on.
POSIX2_UPE
Indicates if the system supports the User Portability Utilities Option.
POSIX2_VERSION
Specifies the version of POSIX.2 adhered to in this release.
POSIX2_BC_BASE_MAX
Specifies the minimum conforming value for BC_BASE_MAX.
POSIX2_BC_DIM_MAX
Specifies the minimum conforming value for BC_DIM_MAX.
POSIX2_BC_SCALE_MAX
Specifies the minimum conforming value for BC_SCALE_MAX.
POSIX2_BC_STRING_MAX
Specifies the minimum conforming value for BC_STRING_MAX.
POSIX2_COLL_WEIGHTS_MAX
Specifies the minimum conforming value for EQUIV_CLASS_MAX.
POSIX2_EXPR_NEST_MAX
Specifies the minimum conforming value for EXPR_NEST_MAX.
POSIX2_LINE_MAX
Specifies the minimum conforming value for LINE_MAX.
POSIX2_RE_DUP_MAX
Specifies the minimum conforming value for RE_DUP_MAX.
You can use the third form of getconf to find the value of the POSIX.2 standard configuration variables:
_ACL
Specifies that access control lists (ACLs) are supported by the security product and file system.
_PC_ACL_ENTRIES_MAX
Specifies the maximum number of extended ACL entries that can be placed in an access control list for the specified file.
This implementation of getconf also supports the following non-POSIX-conforming name:
_CS_SHELL
Specifies the default shell (command interpreter).
_PC_ACL
Security product supports access control lists (ACLs).
_PC_ACL_ENTRIES_MAX
Maximum number of entries that can be placed in an access control list for a specified file.

Examples

This example uses getconf to find the minimum conforming value for PATH_MAX, which is contained in the variable _POSIX_PATH_MAX. If you issue
getconf _POSIX_PATH_MAX
getconf displays
255

Localization

getconf uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_CTYPE
  • LC_MESSAGES

See Localization for more information.

Exit values

0
The specified parameter_name was valid and getconf displayed its value successfully.
>0
An error occurred.

Portability

POSIX.2, X/Open Portability Guide.

_CS_SHELL is an extension of the POSIX standard. Some symbols are supported only on systems that support POSIX.2.

Related information

bc, expr, sh

See Regular expressions (regexp) for more information about regexp.