bash配置檔案載入順序

2021-07-24 19:20:55 字數 624 閱讀 7407

2015-02-12 11:05

206人閱讀收藏 

舉報

linux

bash配置檔案的分兩大類:

1,全域性配置,比如:/etc/profile,   /etc/profile.d/*.sh,   /etc/bashrc 

2,個人配置,比如:~/.bash_profile,    ~/.bashrc

其中,profile類的檔案記錄的是:1,設定環境變數; 2,執行命令或指令碼;

bashrc類的檔案記錄的是:1,設定本地變數;2,定義命令別名。

bash配置檔案的載入順序分兩種,登入式shell和非登入式shell。

1,登陸式shell是指:1,正常通過終端登入;2,su - username;3,su -l username;

執行順序是:/etc/profile -> /etc/profile.d/*.sh -> ~/.bash_profile -> ~/.bashrc -> /etc/bashrc

2,非登入式shell是指:1,su username;2,圖形終端下的開啟命令視窗;3,自動執行的shell指令碼;

執行順序是:~/bashrc -> /etc/bashrc -> /etc/profile.d/*.sh

bash配置檔案的載入順序

bash配置檔案的載入順序和登陸方式有關,下面先介紹下登陸方式。登陸式shell 非登入式shell profile類檔案作用 bashrc類檔案作用 登陸式shelll配置檔案載入順序 etc profile bash profile bash login profile bash logout....

springboot 配置檔案載入順序

載入本地其他配置檔案 nacos 作為配置中心 有註冊中心nacos 配置 spring boot 有兩種配置檔案 bootstrap.properties bootstrap.yml 定義應用級別的配置 在spring boot 有兩種上下文 bootstrap 應用程式的父上下文 建立配置檔案 ...

bash配置檔案

本文主要對linux系統bash配置檔案進行比較分析。1.首先是兩個全域性的配置檔案。etc profile 此檔案為系統的每個使用者設定環境資訊,當使用者第一次登入時,該檔案被執行。並從 etc profile.d目錄的配置檔案中蒐集shell的設定.etc bash.bashrc 為每乙個執行b...