| Main index | Section 8 | 日本語 | Options |
The following options are available:
| |
Equivalent to
|
| | List all the currently available values except for those which are opaque or excluded from listing via the CTLFLAG_SKIP flag. This option is ignored if one or more variable names are specified on the command line. |
| | |
| Set the buffer size to read from the sysctl to bufsize. This is necessary for a sysctl that has variable length, and the probe value of 0 is a valid length, such as kern.arandom. | |
| | Force the value of the variable(s) to be output in raw, binary format. No names are printed and no terminating newlines are output. This is mostly useful with a single variable. |
| | Print the description of the variable instead of its value. |
| |
Separate the name and the value of the variable(s) with
‘=’.
This is useful for producing output which can be fed back to the
sysctl
utility.
This option is ignored if either
|
| | Print the format of the variable. This is additional information to describe the type of the variable and most useful with struct types such as clockinfo, timeval, and loadavg. |
| | |
|
Specify a file which contains a pair of name and value in each line.
sysctl
reads and processes the specified file first and then processes the name
and value pairs in the command line argument.
Note that when the
| |
| | Format output for human, rather than machine, readability. |
| | Ignore unknown OIDs. The purpose is to make use of sysctl for collecting data from a variety of machines (not all of which are necessarily running exactly the same software) easier. |
| | Display only jail prision sysctl variables (CTLFLAG_PRISON). |
| | |
| Perform the actions inside the jail (by jail id or jail name). | |
| |
Show the length of variables along with their values.
This option cannot be combined with the
|
| |
Show only variable names, not their values.
This is particularly useful with shells that offer programmable
completion.
To enable completion of variable names in
zsh(1) ( ports/shells/zsh),
use the following code:
listsysctls () { set -A reply $(sysctl -AN ${1%.*}) }
compctl -K listsysctls sysctl
To enable completion of variable names in tcsh(1), use:
complete sysctl 'n/*/`sysctl -Na`/'
|
| |
Do not show variable names.
This option is useful for setting shell variables.
For instance, to save the pagesize in variable
psize,
use:
set psize=`sysctl -n hw.pagesize`
|
| | Show opaque variables (which are normally suppressed). The format and length are printed, as well as a hex dump of the first sixteen bytes of the value. |
| | Suppress some warnings generated by sysctl to standard error. |
| | Display only variables that are settable via loader (CTLFLAG_TUN). |
| | Print the type of the variable. |
| | Display only VNET sysctl variables (CTLFLAG_VNET). |
| | Display only writable variables that are not statistical. Useful for determining the set of runtime tunable sysctls. |
| |
Equivalent to
|
| |
As
|
The information available from sysctl consists of integers, strings, and opaque types. The sysctl utility only knows about a couple of opaque types, and will resort to hexdumps for the rest. The opaque information is much more useful if retrieved by special purpose programs such as ps(1), systat(1), and netstat(1).
Some of the variables which cannot be modified during normal system operation can be initialized via loader(8) tunables. This can for example be done by setting them in loader.conf(5). Please refer to loader.conf(5) for more information on which tunables are available and how to set them.
The string and integer information is summarized below. For a detailed description of these variables see sysctl(3) and security(7).
The changeable column indicates whether a process with appropriate privilege can change the value. String and integer values can be set using sysctl.
| Name Ta Type | Changeable |
| kern.ostype Ta string | no |
| kern.osrelease Ta string | no |
| kern.osrevision Ta integer | no |
| kern.version Ta string | no |
| kern.maxvnodes Ta integer | yes |
| kern.maxproc Ta integer | no |
| kern.maxprocperuid Ta integer | yes |
| kern.maxfiles Ta integer | yes |
| kern.maxfilesperproc Ta integer | yes |
| kern.argmax Ta integer | no |
| kern.securelevel Ta integer | raise only |
| kern.hostname Ta string | yes |
| kern.hostid Ta integer | yes |
| kern.clockrate Ta struct | no |
| kern.posix1version Ta integer | no |
| kern.ngroups Ta integer | no |
| kern.job_control Ta integer | no |
| kern.saved_ids Ta integer | no |
| kern.boottime Ta struct | no |
| kern.domainname Ta string | yes |
| kern.filedelay Ta integer | yes |
| kern.dirdelay Ta integer | yes |
| kern.metadelay Ta integer | yes |
| kern.osreldate Ta integer | no |
| kern.bootfile Ta string | yes |
| kern.corefile Ta string | yes |
| kern.logsigexit Ta integer | yes |
| security.bsd.suser_enabled Ta integer | yes |
| security.bsd.see_other_uids Ta integer | yes |
| security.bsd.see_other_gids Ta integer | yes |
| security.bsd.see_jail_proc Ta integer | yes |
| security.bsd.unprivileged_proc_debug Ta integer | yes |
| security.bsd.unprivileged_read_msgbuf Ta integer | yes |
| vm.loadavg Ta struct | no |
| hw.machine Ta string | no |
| hw.model Ta string | no |
| hw.ncpu Ta integer | no |
| hw.byteorder Ta integer | no |
| hw.physmem Ta integer | no |
| hw.usermem Ta integer | no |
| hw.pagesize Ta integer | no |
| hw.floatingpoint Ta integer | no |
| hw.machine_arch Ta string | no |
| hw.realmem Ta integer | no |
| machdep.adjkerntz Ta integer | yes |
| machdep.disable_rtc_set Ta integer | yes |
| machdep.guessed_bootdev Ta string | no |
| user.cs_path Ta string | no |
| user.bc_base_max Ta integer | no |
| user.bc_dim_max Ta integer | no |
| user.bc_scale_max Ta integer | no |
| user.bc_string_max Ta integer | no |
| user.coll_weights_max Ta integer | no |
| user.expr_nest_max Ta integer | no |
| user.line_max Ta integer | no |
| user.re_dup_max Ta integer | no |
| user.posix2_version Ta integer | no |
| user.posix2_c_bind Ta integer | no |
| user.posix2_c_dev Ta integer | no |
| user.posix2_char_term Ta integer | no |
| user.posix2_fort_dev Ta integer | no |
| user.posix2_fort_run Ta integer | no |
| user.posix2_localedef Ta integer | no |
| user.posix2_sw_dev Ta integer | no |
| user.posix2_upe Ta integer | no |
| user.stream_max Ta integer | no |
| user.tzname_max Ta integer | no |
| user.localbase Ta string | no |
| <sys/sysctl.h> | definitions for top level identifiers, second level kernel and hardware identifiers, and user level identifiers |
| <sys/socket.h> | definitions for second level network identifiers |
| <sys/gmon.h> | definitions for third level profiling identifiers |
| <vm/vm_param.h> | definitions for second level virtual memory identifiers |
| <netinet/in.h> | definitions for third level Internet identifiers and fourth level IP identifiers |
| <netinet/icmp_var.h> | |
| definitions for fourth level ICMP identifiers | |
| <netinet/udp_var.h> | |
| definitions for fourth level UDP identifiers | |
sysctl kern.maxproc
To set the maximum number of processes allowed per uid to 1000, one would use the following request:
sysctl kern.maxprocperuid=1000
Information about the system clock rate may be obtained with:
sysctl kern.clockrate
Information about the load average history may be obtained with:
sysctl vm.loadavg
More variables than these exist, and the best and likely only place to search for their deeper meaning is undoubtedly the source where they are defined.
In FreeBSD 2.2, sysctl was significantly remodeled.
| SYSCTL (8) | January 31, 2025 |
| Main index | Section 8 | 日本語 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | UNIX is a four-letter word! | ” |