nsysctl is a tool to get or set the FreeBSD kernel state supporting libxo and a lot of 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 system state

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

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

     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
             use a buffer of <bufsize> bytes.

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

     -d      Show state description.

     -e sep  Use <sep> as separator.

     -F      Display format string.

     -f filename
             Load states to get or set from <filename>.

     -G      Show true-flags.

     -g      Print flags.

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

     -I      Show Internal nodes, default only leaves.

     -i      Ignore unknown state.

     -l      Display label.

     -N      Print name.

     -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 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 -e "name"     % nsysctl -Nv -e '=' "name"
           % sysctl -N "name"     % nsysctl -N  "name"
           % sysctl -n "name"     % nsysctl -v  "name"
           % sysctl -d "name"     % nsysctl -Nd "name"
           % sysctl -a            % nsysctl -NVa
           % sysctl -ae           % nsysctl -Nva -e '='
           % 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            April 27, 2019            FreeBSD 13.0-CURRENT