隨手筆記NO.4

shell的分類

登陸式shell:

正常一般某終端登陸
su - USERNAME 
su -l USERNAME

非登陸式shell:

su USERNAME
圖形終端下打開命令窗口
自動執行的shell腳本

他們之間的區別

在說以前首先看咱們的bash的配置文件:
全局配置
    /etc/profile, /etc/profile.d/*.sh, /etc/bashrc
我的配置
    ~/.bash_profile, ~/.bashrc

profile類的文件:
    設定環境變量
    運行命令或腳本
bashrc類的文件:
    設定本地變量
    定義命令別名

這就是區別(讀取的文件和順序都不一樣)shell

登陸式shell如何讀取配置文件?
    /etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bashrc --> /etc/bashrc
    非登陸式shell如何讀取配置文件?
    ~/.bashrc --> /etc/basrc --> /etc/profile.d/*.sh
相關文章
相關標籤/搜索