• 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 Examples in Linux

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. 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.

Syntax

The syntax of the sysctl command is:

# sysctl [options]

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. featureCounts: command not found
  2. grub-mkconfig Command Examples in Linux
  3. Unable to Run X Applications Through SSH in Linux
  4. How to Delete ASM Disk on Multipath Device in CentOS/RHEL
  5. usermod: command not found
  6. How to Verify the Syntax of the file /etc/ssh/sshd_config
  7. module: command not found
  8. Installation Steps of jEdit on Ubuntu Linux
  9. hlint: command not found
  10. fcrackzip Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright