nsysctl is a tool to get or set the FreeBSD kernel state using libxo and extra options, this manual page is intended as a reference document only, please refer to nsysctl tutorial for a more thorough description.

Legal notice: FreeBSD© is a registered trademark of the FreeBSD Foundation.

NSYSCTL(8)              FreeBSD System Manager's Manual             NSYSCTL(8)

     nsysctl - get or set kernel state

     nsysctl [--libxo opts [-r tagname]] [-DdFIilmNpqTtWy [V|v [h [b|o|x]]]]
             [-e sep] [-B :bufsize] [-f filename] name[=value] ...
     nsysctl [--libxo opts [-r tagroot]] [-DdFIlmNpqSTtWy [V|v [h [b|o|x]]]]
             [-e sep] [-B bufsize] -A|a|X

     The systems maintains a "Management Information Base" ("MIB") of kernel
     states.  The nsysctl tool can get the value and allows users with
     appropriate privilege to set kernel state.

     The output is explicitly indicated by the options, see COMPATIBILITY for
     a comparison with sysctl(8).

     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.

     -a      Display all states.

     -b      Print value in binary format.

     -B bufsize
             Try to get a value of at least <bufsize> bytes.

     -D      Equivalent to -d -F -l -m -N -t -v -y.

     -d      Show state description.

     -e sep  Use <sep> as separator.

     -F      Display flags.

     -f filename
             Load kernel state and/or new values from <filename>.

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

     -I      Show Internal nodes, default only leaves.

     -i      Ignore unknown state.

     -l      Display label.

     -m      Show format string.

     -N      Print name.

     -o      Show value in hex format until 16 bytes.

     -p      Display "[property-name]: ".

     -q      Avoid to show some warning.

     -r tagroot
             Specify a <tagroot> with libxo.

     -S      Display magical kernel states.

     -T      Show only variables that are settable via loader.

     -t      Print type.

     -V      Show value, if value is not "showable" hidden the state.

     -v      Display value.

     -W      Display only writable variables that are not statistical.

     -X      Equivalent to -a -x.

     -x      Print value in hex format.

     -y      Show id.

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

     To get the hostname:

           nsysctl -Nv kern.hostname

     To set the hostname:

           nsysctl kern.hostname=myBSD

     Dump all info about a state:

           nsysctl -Dp -e ', '  kern.ostype

     Dump all info about a state in xml format:

           nsysctl --libxo=xml,pretty -r ROOT-NAME -D kern.ostype

           /sbin/sysctl           /usr/local/sbin/nsysctl
           % sysctl    "name"     % nsysctl -Nv "name"
           % sysctl -N "name"     % nsysctl -N  "name"
           % sysctl -n "name"     % nsysctl -v  "name"
           % sysctl -d "name"     % nsysctl -Nd "name"
           % sysctl -a            % nsysctl -NVa
           % sysctl -aN           % nsysctl -aN
           % sysctl -ad           % nsysctl -aNd
           % sysctl -at           % nsysctl -aNt
           % sysctl -ao           % nsysctl -aNVo
           % sysctl -ax           % nsysctl -aNx

     sysctl(3), sysctlmibinfo(3), sysctl(8)

     The nsysctl utility first appeared in FreeBSD 13.0.

     The nsysctl utility and this manual page were written by Alfonso Sabato
     Siciliano <alf.siciliano@gmail.com>

FreeBSD 13.0-CURRENT           February 23, 2019          FreeBSD 13.0-CURRENT