• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

sysctl: command not found

by admin

To view or edit any security-related parameter of Linux kernel, there is the /etc/sysctl.conf file. All the parameters are stored in this file and this is read during boot time. If you wish to see the available kernel parameters in this file, you can do so by running the command:

# sysctl -a

This command will display an extensive list of configuration settings. The kernel security parameters are also in this list.

Syntax

The syntax of the sysctl command is:

# sysctl [options]

It has various options, as defined in the following table.

Option Description
-a Display all parameters and their current values.
-w {parameter}={value} Set a parameter value.
-p [file name] Load sysctl settings from the specified file, or /etc/sysctl.conf if no file name is provided.
-e Ignore errors about unknown keys.
-r {pattern} Apply a command to parameters matching a given pattern, using extended regular expressions.

If you encounter the below error while running the sysctl command:

sysctl: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
Debian apt-get install procps
Ubuntu apt-get install procps
Alpine apk add procps
Arch Linux pacman -S procps-ng
Kali Linux apt-get install procps
CentOS yum install procps-ng
Fedora dnf install procps-ng
Raspbian apt-get install procps

sysctl Command Examples

1. Show all available variables and their values:

# sysctl -a

2. Set a changeable kernel state variable:

# sysctl -w section.tunable=value

3. Get currently open file handlers:

# sysctl fs.file-nr

4. Get limit for simultaneous open files:

# sysctl fs.file-max

5. Apply changes from `/etc/sysctl.conf`:

# sysctl -p

Filed Under: Linux

Some more articles you might also be interested in …

  1. Intel I219-LM Centos 6 network failed to start
  2. ufw: command not found
  3. Common Error Messages from Command xfs_repair in Linux
  4. CentOS / RHEL : How to change password hashing algorithm
  5. Understanding /proc/meminfo file (Analyzing Memory utilization in Linux)
  6. How to use ‘yum’ to connect ULN on CentOS/RHEL/OEL 6
  7. apt-key Command Examples in Linux
  8. avifenc Command in Linux with Examples
  9. CentOS / RHEL : Configure yum automatic updates with yum-cron service
  10. 10 useful cron examples to schedule jobs in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright