logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

getconf.1 (1838B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: 0BSD
  4. .Dd March 17, 2025
  5. .Dt GETCONF 1
  6. .Os
  7. .Sh NAME
  8. .Nm getconf
  9. .Nd get configuration values
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Ar system_var
  13. .Nm
  14. .Ar path_var
  15. .Ar path
  16. .Nm
  17. .Fl a
  18. .Op Ar path
  19. .Sh DESCRIPTION
  20. In the first synopsis form,
  21. .Nm
  22. prints the system variable specified by the
  23. .Ar system_var
  24. operand.
  25. Which are obtained, in order, by:
  26. .Xr sysconf 3 ;
  27. .Xr confstr 3 ;
  28. .Xr limits.h 0 .
  29. .Pp
  30. In the second synopsis form,
  31. .Nm
  32. prints the variable specified by the
  33. .Ar path_var
  34. operand for the path specified by the
  35. .Ar path
  36. operand.
  37. Which are obtained via
  38. .Xr pathconf 3 .
  39. .Pp
  40. When
  41. .Fl a
  42. is set
  43. .Nm
  44. prints all the known system and path variables.
  45. If
  46. .Ar path
  47. is unspecified,
  48. .Nm
  49. behaves as if it was set to
  50. .Ql \&.
  51. .Sh STDOUT
  52. If the specified variable is found, it is printed out as-is,
  53. when it isn't found but valid it is printed as "undefined".
  54. .Pp
  55. When
  56. .Fl a
  57. is used,
  58. each variable is printed on a line in "name: value" format,
  59. with "value" being
  60. .Ql undefined
  61. when not found.
  62. .Sh EXIT STATUS
  63. .Ex -std
  64. .Sh EXAMPLES
  65. Getting the maximum amount of supplemental groups:
  66. .Dl Cm getconf NGROUPS_MAX
  67. .Pp
  68. Getting the maximum amount of bytes a filename can hold in
  69. the current directory:
  70. .Dl Cm getconf NAME_MAX ./
  71. .Sh SEE ALSO
  72. .Xr limits.h 0p ,
  73. .Xr confstr 3 ,
  74. .Xr pathconf 3 ,
  75. .Xr sysconf 3
  76. .Sh STANDARDS
  77. Except for it's lack of support of the
  78. .Fl v Ar specification
  79. argument,
  80. .Nm
  81. should be compliant with the
  82. IEEE Std 1003.1-2024 (“POSIX.1”)
  83. specification.
  84. .Pp
  85. The
  86. .Fl a
  87. option was added in
  88. .Lk https://www.austingroupbugs.net/view.php?id=1808 "0001808: Add option -a to getconf utility - Austin Group Issue Tracker"
  89. .Sh AUTHORS
  90. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me