Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
NSYSCTL(8)		    System Manager's Manual		    NSYSCTL(8)

NAME
       nsysctl -- get or set system state

SYNOPSIS
       nsysctl	 [--libxo   options   [-r   tagroot]]	[-DdeFGgHIilnOpqTtvWz]
	       [-N | -h	[b | o | x]]  [-B  bufsize]  [-s  sep]	[-f  filename]
	       name[=value[,value]] ...
       nsysctl	 [--libxo   options   [-r   tagroot]]  [-DdeFGgHIklnOpqSTtvWz]
	       [-N | -Vh [b | o	| x]] [-B bufsize] [-s sep] -a

DESCRIPTION
       The nsysctl utility can get or set the state of the System at  runtime.
       The System exposes the available	parameters as objects of a "Management
       Information Base" (MIB),	nsysctl	can explore the	MIB, print the proper-
       ties  of	 an  object, get or set	its value and show the output in human
       and machine readable formats.

       An object is identified by an Object Identifier (OID), a	series of num-
       bers, it	is possible to replace a number	with a string to obtain	an ob-
       ject name, e.g.,	[1.1] -> "kern.ostype",	nsysctl	can receive  in	 input
       one or more name, eventually with a new value, or -a for	all objects.

       nsysctl	requires  the  sysctlinfo(4)  interface.  To load the required
       kernel module at	boot time, place the following line in loader.conf(5):

	     sysctlinfo_load="YES"

       The following options are available:

       --libxo options
	       Generate	output via libxo(3) in a selection of different	 human
	       and machine readable formats, see xo_parse_args(3).

       -A      Equivalent to -a	-o, obsolete.

       -a      Display all objects.

       -b      Print value in binary format.

       -B _bufsize_
	       use a buffer of _bufsize_ bytes.

       -D      Equivalent to -d	-F -G -H -l -O -t.

       -d      Show description.

       -e      Use "=" as separator.

       -F      Display format string.

       -f _filename_
	       Load objects from _filename_.

       -G      Show true flags.

       -g      Print flags.

       -H      Show the	object handler status.

       -h      Try to show values in a human-friendly format.

       -I      Show internal nodes, only leaves	are printed by default.

       -i      Ignore unknown objects.

       -k      Show object with	SKIP flag with -a.

       -l      Print aggregation label.

       -m      Alias for -S.

       -N      Hide value.

       -n      Hide name.

       -O      Display OID.

       -o      Show value in hex format	until 16 bytes.

       -p      Display [ "PROPERTY-NAME" ]: "property-value".

       -q      Avoid to	show some warning.

       -r _tagroot_
	       Specify a _tagroot_ with	libxo.

       -S      Display also the	"sysctl.*" subtree with	-a.

       -s _sep_
	       Use _sep_ as separator.

       -T      Show only settable objects via loader.

       -t      Print type.

       -V      By default -a hides an object without a value, this option dis-
	       able this feature.

       -v      nsysctl version.

       -W      Display only writable objects that are not statistical.

       -X      Equivalent to -a	-x, obsolete.

       -x      Print value in hex format.

       -y      Alias for -O.

       -z      Toggle  numeric or boolean value.  0 becomes 1, any value other
	       than 0 becomes 1.  Only	the  first  element  of	 an  array  is
	       switched.

EXIT STATUS
       The nsysctl utility exits 0 on success, and >0 if an error occurs.

EXAMPLES
       To get an object	value:

	     nsysctl kern.hostname

       To set an object	value:

	     nsysctl kern.hostname=myBSD

       Print object info:

	     nsysctl -pD kern.ostype

       Print object info in xml:

	     nsysctl --libxo=xml,pretty	-D kern.ostype

COMPATIBILITY
       sysctl(8)  prints  internal  and	SKIP nodes with	-aN, -ad and -at, only
       leaves avoiding SKIP nodes otherwise, to	reproduce with nsysctl:
	     /sbin/sysctl	      /usr/local/sbin/nsysctl
	     % sysctl -aN	      %	nsysctl	-aNIk
	     % sysctl -ad	      %	nsysctl	-adIk
	     % sysctl -at	      %	nsysctl	-atIk

SEE ALSO
       sysctl(3),    sysctlmibinfo2(3),	   xo_parse_args(3),	sysctlinfo(4),
       sysctl(8)

AUTHORS
       nsysctl	   was	   written     by     Alfonso	  Sabato     Siciliano
       <asiciliano@FreeBSD.org>.

FreeBSD	13.2		       December	6, 2022			    NSYSCTL(8)

NAME | SYNOPSIS | DESCRIPTION | EXIT STATUS | EXAMPLES | COMPATIBILITY | SEE ALSO | AUTHORS

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=nsysctl&sektion=8&manpath=FreeBSD+14.0-RELEASE+and+Ports>

home | help