SHELL的類型
登錄式shell
正常通過終端登錄
su – USERNAME
su –l USERNAME
非登錄式shell:
su USERNAME
圖形終端下打開命令窗口
bash的配置文件
全局配置
/etc/profile,/etc/profile.d/*.sh,/etc/bashrc
個人配置
~/.bash_profile,~/.bashrc
profile類的文件:
設定環境變量
運行命令或腳本
bashrc類的文件
設定本地變量
定義命令別名
登錄式shell如何讀取配置文件?
/etc/profile –> /etc/profile.d/*.sh –> ~/.bash_profile --->~/.bashrc –>/etc/bashrc
非登錄shell的如何配置文件
~/.bashrc –>/etc/basrc –/etc/profile.d/*.sh
登錄時打印出歡迎加時間
vim /root/.bash_profile
echo "Hello,wangyijun ,Welcome to our system `date`"
把登錄語言臨時改成英文
vim /root/.bashrc
export LANG=en.US.utf8