getconf
TLDR
List all configuration values available
SYNOPSIS
getconf [-v spec] systemvar_
getconf [-v spec] pathvar pathname_
DESCRIPTION
getconf retrieves system configuration variables defined by POSIX and system-specific extensions. These values represent system limits and capabilities that applications can query to adapt their behavior.
Variables fall into two categories: system-wide values (like CHILDMAX, PAGESIZE) and pathname-specific values (like PATHMAX, NAMEMAX) that may vary by filesystem.
This is useful for shell scripts that need to query system limits without hardcoding values, ensuring portability across different systems.
PARAMETERS
-a
Display all configuration variables and their values-v SPEC
Use specification SPEC for configuration valuesLONG_BIT
Number of bits in a long integer (32 or 64)CHILD_MAX
Maximum number of processes per userOPEN_MAX
Maximum number of files a process can have openPAGE_SIZE
System memory page size in bytesPATH_MAX
Maximum length of a file pathHOST_NAME_MAX
Maximum length of a hostname_NPROCESSORS_ONLN
Number of processors currently online
CAVEATS
Some values may be indeterminate (shown as "undefined"). Pathname-specific variables can return different values for different filesystems. Not all variables are supported on all systems.
HISTORY
getconf is part of the POSIX standard and has been available on Unix-like systems since the early 1990s. It provides a standardized way to query the same configuration values that the C functions sysconf(), pathconf(), and confstr() return.


