Skip to content

This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!


sysctl is a tool for examining and changing kernel parameters at runtime (package procps-ng). sysctl is implemented in procfs, the virtual process file system at /proc/.


Table of contents


Possible locations for sysctl configuration files are:

  • /etc/sysctl.d/*.conf
  • /run/sysctl.d/*.conf
  • /usr/local/lib/sysctl.d/*.conf
  • /usr/lib/sysctl.d/*.conf
  • /lib/sysctl.d/*.conf
  • /etc/sysctl.conf


  • List all current kernel parameters:

    $ sysctl -a
    > See for the > documentation about all parameters.

  • List all current kernel parameters of a specific parameters group (e.g. net.ipv6):

    $ sysctl -a --pattern '^net.ipv6'
    > See for the > documentation about the whole net group.

  • Print a single/specific parameter (e.g. fs.file-max):

    $ sysctl fs.file-max
        > fs.file-max = 3270749

  • Apply changes from sysctl config file:

    $ sudo sysctl -p

  • Modify a specific kernel parameter (e.g. vm.swappiness):

    $ sysctl -w vm.swappiness=10

    The change takes effect immediately, but it is not persistent. After a system reboot, the default value is loaded.

    To set a parameter permanently, you will need to write the settings to the configuration file.

    Another way to change parameters is to write the settings to the files in the /proc/sys directory, e.g.:

    $ echo 1 > /proc/sys/net/ipv4/ip_forward

If this cheat sheet has been useful to you, then please consider leaving a star here.