Viewing kernel variables
There are over 100 kernel state variables. To view a specific variable, use:sysctl variable-name
To view all variables, use:sysctl -a
Setting kernel variables
You must be root to set a kernel variable. To set a kernel variable, use the -w switch:sysctl -w variable-name=value
If you are running OS X as a file server and have a lot of people connecting and sharing files, you might want to increase the maximum number of open files allowed by the kernel. This can be tuned using the kern.maxfiles
variable. The default value is 12288. To increase it to 50000, use: sysctl -w kern.maxfiles=50000