1. 程式人生 > >Linux調優

Linux調優

命令行 black 賬號 init.d 調用 miss tab filter 沒有

關閉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調優