1.set
環境變量:用來定義bash的工作特性,保存當前會話的屬性信息
顯示所有環境變量:export ,env ,printenv
2.bash的配置文件
profile:為交互式登錄用戶提供配置
/etc/profile:全局
/etc/profile/*.sh
~/bash/profile:個人配置,僅當前用戶有效
bashrc:非交互式登錄的用戶提供配置
/etc/bashrc:全局
~/.bashrc:個人配置
交互式登錄:直接通過終端輸入用戶信息登錄系統
非交互式登錄:su userName,圖形界面的終端
3.proflie
設定環境變量
運行命令或角本
4.bashrc
設定本地變量
定義命令別名
5.source
重讀配置文件命令,source . 縮寫(.)
6.交互式登錄用戶
/etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> /etc/bashrc
非交互式登錄用戶
~/.bashrc --> /etc/bashrc -->/etc/profile.d/*.s
7.bash -n 腳本文件: 腳本語法錯誤檢測
8.for循環
for var_Name in 列表 ; do
語句1
2
。
done
9.列表生成
生成數字序列 {start...end} seq[sart][setp]end