getconf.1 (1838B)
- .\" utils-std: Collection of commonly available Unix tools
- .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- .\" SPDX-License-Identifier: 0BSD
- .Dd March 17, 2025
- .Dt GETCONF 1
- .Os
- .Sh NAME
- .Nm getconf
- .Nd get configuration values
- .Sh SYNOPSIS
- .Nm
- .Ar system_var
- .Nm
- .Ar path_var
- .Ar path
- .Nm
- .Fl a
- .Op Ar path
- .Sh DESCRIPTION
- In the first synopsis form,
- .Nm
- prints the system variable specified by the
- .Ar system_var
- operand.
- Which are obtained, in order, by:
- .Xr sysconf 3 ;
- .Xr confstr 3 ;
- .Xr limits.h 0 .
- .Pp
- In the second synopsis form,
- .Nm
- prints the variable specified by the
- .Ar path_var
- operand for the path specified by the
- .Ar path
- operand.
- Which are obtained via
- .Xr pathconf 3 .
- .Pp
- When
- .Fl a
- is set
- .Nm
- prints all the known system and path variables.
- If
- .Ar path
- is unspecified,
- .Nm
- behaves as if it was set to
- .Ql \&.
- .Sh STDOUT
- If the specified variable is found, it is printed out as-is,
- when it isn't found but valid it is printed as "undefined".
- .Pp
- When
- .Fl a
- is used,
- each variable is printed on a line in "name: value" format,
- with "value" being
- .Ql undefined
- when not found.
- .Sh EXIT STATUS
- .Ex -std
- .Sh EXAMPLES
- Getting the maximum amount of supplemental groups:
- .Dl Cm getconf NGROUPS_MAX
- .Pp
- Getting the maximum amount of bytes a filename can hold in
- the current directory:
- .Dl Cm getconf NAME_MAX ./
- .Sh SEE ALSO
- .Xr limits.h 0p ,
- .Xr confstr 3 ,
- .Xr pathconf 3 ,
- .Xr sysconf 3
- .Sh STANDARDS
- Except for it's lack of support of the
- .Fl v Ar specification
- argument,
- .Nm
- should be compliant with the
- IEEE Std 1003.1-2024 (“POSIX.1”)
- specification.
- .Pp
- The
- .Fl a
- option was added in
- .Lk https://www.austingroupbugs.net/view.php?id=1808 "0001808: Add option -a to getconf utility - Austin Group Issue Tracker"
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me