About Linux FAQ

Browse More FAQs:

Linux set sysctl variables

Posted by Vivek Gite [Last updated: February 9, 2007]

Q. How do I set sysctl variables under Debian Linux?

A. sysctl is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/. Procfs is required for sysctl support in Linux. You can use sysctl to both read and write sysctl data.

You must login as the root user to use any one of the following command.

Method # 1: Setting value via procfs

You can use standard echo command to write data to variables:
# echo "value" > /proc/sys/location/variable

Method # 2: Temporary on the command line

Use sysctl command with -w option when you want to change a sysctl setting:
sysctl -w variable=value

Method # 3: Configuration file /etc/sysctl.conf

This is recommended way. First open /etc/sysctl.conf file
# vi /etc/sysctl.conf
Now add value:
variable = value

Close and save the changes. Type the following command to load sysctl settings from the file /etc/sysctl.conf file:
# sysctl -p

Read man page of sysctl for information:
$ man sysctl

Linux Powered Asus EEE Laptop PC From $299

E-mail    Print    Can't find an answer to your question? Contact us

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.