0

I see on the web two different commands to load sysctl custom parameters:

  • sysctl --system
  • sysctl -p

Is there any difference between the two commands? I know the second one I posted can take the path of a file to load but without any file specified, everything will be loaded.

Artem S. Tashkinov
32.8k5 gold badges52 silver badges91 bronze badges
asked Jan 24, 2024 at 9:51

1 Answer 1

0

The sysctl --system load settings from all configuration files.

The sysctl -p will load settings from the default /etc/sysctl.conf.

man sysctl:

 -p[FILE], --load[=FILE]
 Load in sysctl settings from the file specified or /etc/sysctl.conf if none given. Specifying - as filename means
 reading data from standard input. Using this option will mean arguments to sysctl are files, which are read in the
 order they are specified. The file argument may be specified as regular expression.
 --system
 Load settings from all system configuration files. Files are read from directories in the following list in given
 order from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent direc‐
 tories is ignored.
 /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
answered Jan 24, 2024 at 10:04
1
  • Perhaps you could explain the reasons for (what purpose would serve) configuration files different from default. Commented Jan 24, 2024 at 10:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.