zoukankan      html  css  js  c++  java
  • linux命令学习-3-sysctl

    sysctl 内核变量配置

    Usage:
    sysctl [options] [variable[=value] ...]
     
    NAME
    sysctl - configure kernel parameters at runtime
     
    DESCRIPTION
    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.
     
    Options:
    -a, --all display all variables
    -A alias of -a
    -X alias of -a
    --deprecated include deprecated parameters to listing
    -b, --binary print value without new line
    -e, --ignore ignore unknown variables errors
    -N, --names print variable names without values
    -n, --values print only values of a variables
    -p, --load[=<file>] read values from file
    -f alias of -p
    --system read values from all system directories
    -r, --pattern <expression>
    select setting that match expression
    -q, --quiet do not echo variable set
    -w, --write enable writing a value to variable
    -o does nothing
    -x does nothing
    -d alias of -h
     
    -h, --help display this help and exit
    -V, --version output version information and exit
      
    实例1:
    /sbin/sysctl -a
    显示所有变量
     
    实例2:
    只打印固定的一个变量
    /sbin/sysctl -n kernel.hostname
     
     
    /sbin/sysctl -n net.ipv4.tcp_timestamps
     
     
    实例3:
    写入内核变量
    /sbin/sysctl -w kernel.domainname="example.com"
     
     
    实例4:
    读取数据
    /sbin/sysctl -p/etc/sysctl.conf
    无输出
     
    实例5:
    正则匹配
    /sbin/sysctl -a --pattern forward
     
     
    /sbin/sysctl -a --pattern forward$
     
     
    /sbin/sysctl -a --pattern 'net.ipv4.conf.(eth|wlan)0.arp'
     
     
     
     
  • 相关阅读:
    BZOJ 2654: tree
    洛谷P1972[SDOI2009]HH的项链
    洛谷 P3833 [SHOI2012]魔法树
    P2167 [SDOI2009]Bill的挑战
    洛谷 P2145 [JSOI2007]祖码
    洛谷 P4170 [CQOI2007]涂色
    P2024 [NOI2001]食物链
    USACO 2012 December ZQUOJ 24122 Scrambled Letters(二分)
    USACO 2012 December ZQUOJ 24128 Wifi Setup(动态dp)
    2013长春网赛1009 hdu 4767 Bell(矩阵快速幂+中国剩余定理)
  • 原文地址:https://www.cnblogs.com/davygeek/p/5329973.html
Copyright © 2011-2022 走看看