linux的一些使用

linux的一些使用
  1. 检查所有的开机启动项:
chkconfig --list
  1. 设置开机启动
1. 编辑文件/etc/rc.local 添加需要的开机启动项
   eg、/etc/init.d/tengine start #设置tengine开机启动

2. 自己添加的shekk脚本
   放到 /etc/profile.d/文件夹下,系统启动后会自动执行

3. 通过chkconfig命令
   启动脚本放到/etc/init.d/ 或者 /etc/rc.d/init.d/下(前者是后者的软链)
   然后执行 chkconfig on
更多chkconfig的使用、请参考 chkconfig --help

linux下各种配置文件的加载顺序:

“`
通常Linux下的配置文件:
/etc/profile /etc/profile.d/*.sh ~/.bash_profile ~/.bashrc /etc/bashrc

不同场景下的配置文件的加载机制不同,可以分3种情况
1. 正常用户登录进入bash环境:
/etc/profile > /etc/profile.d/*.sh > ~/.bash_profile > ~/.bashrc > /etc/bashrc

  1. 使用su切换用户
    ~/.bashrc > /etc/bashrc > /etc/profile.d/*.sh

  2. 非登录情况 nologin
    ~/.bashrc > /etc/bashrc > /etc/profile.d/*.sh

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值