歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Linux Bash的環境配置文件

Linux Bash的環境配置文件

日期:2017/3/3 16:16:45   编辑:關於Linux

當用戶登陸時,將讀取以下兩個配置文件:

1)/etc/profile:系統全局配置文件,最好不要修改該文件

2)~/.bash_profile或~/.bash_login或~/.profile:用戶私有的配置文件

全局配置文件 - /etc/profile

/etc/profile會依次調用下列文件:

1)/etc/inputrc

2)/etc/profile.d/*.sh:如果你需要幫所有用戶設置一些共享的命令別名時,可以在這個目錄下創 建擴展名為.sh的文件

3)/etc/sysconfig/i18n

個人配置文件

個人配置文件將根據如下優先級讀取,讀到一個即停止:

1)~/.bash_profile

2)~/.bash_login

3)~/.profile

其中默認情況下,~/.bash_profile還會讀取~/.bashrc,而~/.bashrc又會讀取/etc/bashrc

手動讀取環境配置文件命令 - source或小數點(.)

通過source或小數點(.)可以手動讀取配置文件。

~/.bash_history: 歷史命令記錄在這裡

~/.bash_logout:用戶注銷時執行的命令

 

Copyright © Linux教程網 All Rights Reserved