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
Linux調優