1、查看系統(tǒng)版本等命令--uname
查看系統(tǒng)版本 uname -r
查看系統(tǒng) uname -m
[root@apple ~]#uname -r
3.10.0-957.el7.x86_64
[root@apple ~]#uname -m
x86_64
環(huán)境變量
特點(diǎn):
1.系統(tǒng)設(shè)置 創(chuàng)建 顯示或配置系統(tǒng)特性
2.名字大寫
3.可以在linux下面隨處使用 一般含義一樣常見的環(huán)境變量
UID當(dāng)前用戶uid信息
PATH存放的是命令的位置/路徑
修改環(huán)境變量
臨時(shí)修改
export PS1='[\u@\h \w]$'
永久修改
寫入/etc/profile修改完成后source /etc/profile重新加載
檢查echo $PS1
開啟關(guān)閉selinux
永久修改
操作前備份 操作后檢查
cp /etc/selinux/config /etc/selinux/config.bak
編輯
SELINUX=enforcingSELinux開啟
SELINUX=permissiveSELinux關(guān)閉 還會(huì)有警告信息
SELINUX=disabledSELinux徹底關(guān)閉
改完之后需重啟生效
臨時(shí)修改
getenforce查看當(dāng)前狀態(tài)
set enforce更改當(dāng)前狀態(tài)(1表示開啟 0表關(guān)閉有提示)
防火墻的開啟關(guān)閉
systemctl stop firewalld臨時(shí)關(guān)閉防火墻
systemctl start firewalld臨時(shí)關(guān)閉防火墻
systemctl status firewalld查看防火墻當(dāng)前狀態(tài)
systemctl disable firewalld永久關(guān)閉防火墻
systemctl enable firewalld永久關(guān)閉防火墻
永久執(zhí)行需要重啟之后生效
優(yōu)化yum源
下載對(duì)應(yīng)的阿里云鏡像
(curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo)
yum安裝
wget命令
下載epel源
(wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo)
完成
環(huán)境變量 $LANG
修改系統(tǒng)字符集
[root@apple /oldboy]#echo $LANG
en_US.utf8
zh_CN.utf8
[root@apple /tmp]#localectl set-locale LANG=en_US.utf8
tree vim wget bash-completion bash-completion-extras lrzsz net-tools sysstat iotop iftop htop unzip nc nmap telnet bc psmisc httpd-tools bind-utils nethogs
感謝參閱?。?!