• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
返回主页

大眼侠

  • 博客园
  • 首页
  • 新随笔
  • 联系
  • 订阅
  • 管理

Linux调优

关闭SElinux

1.修改配置文件

sed - i "s#SELINUX=enforcing#SELINUX=disabled#g" /etc/selinux/config

查看状态

[root@bianzhuo ~]# getenforce

Enforcing

[root@bianzhuo ~]# setenforce

usage: setenforce [ Enforcing | Permissive | 1 | 0 ]

[root@bianzhuo ~]# setenforce 0

修改的配置文件得重启,为了不重启,setenforce

2. 运行级别

 

0-关机

1-单用户

2-没有NFS的多用户

3-命令行模式

4-没有使用的

5-桌面

6-重启

查看运行的级别

转换运行级别

 

 

关机

shutdown(halt、init 0)

shutdown -h now

-r reboot after shutdown

-h halt or power off after shutdown

重启

reboot (init )

shutdown -r now

临时关闭防火墙及查看状态

[root@bianzhuo ~]# /etc/init.d/iptables stop

iptables: Setting chains to policy ACCEPT: filter [ OK ]

iptables: Flushing firewall rules: [ OK ]

iptables: Unloading modules: [ OK ]

[root@bianzhuo ~]# /etc/init.d/iptables status

iptables: Firewall is not running.

 

永久关闭防火墙

字符集的调整

 

设置账号超时时间

查看历史纪录

调用某一条历史记录

清楚历史纪录

清除指定的历史纪录

linux特殊变量

export HISTSIZE=5 控制历史纪录显示数量

 

source /etc/profile

posted @ 2019-02-15 23:50  大眼侠  阅读(139)  评论(0)    收藏  举报
刷新页面返回顶部

公告

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3