linux:/etc/enviroment /etc/profile/ /etc/bashrc ~/.bashrc ~/.bashrc_profile
1 /etc/enviroment里面只有key=value沒用命令,/etc/profile會讀取/etc/enviroment里面設置的變量。
2 /etc/profile中設定的變量(全局)的可以作用于任何用戶,而~/.bashrc等中設定的變量(局部)只能繼承/etc/profile中的變量,他們是"父子"關系.
3 /etc/profile用于設環境變量,其他函數和別名,在/etc/bashrc里設
4 先去調用系統級的/etc/bashrc的別名和函數,然后才是 ~/.bashrc
5 bash_profile總是被設置成先讀取相同目錄下~/.bashrc的內容
aix: /etc/enviroment /etc/profile ~/.profile
1 /etc/enviroment里面只有key=value沒用命令,/etc/profile會讀取/etc/enviroment里面設置的變量。
2 /etc/profile中設定的變量(全局)的可以作用于任何用戶,而~/.bashrc等中設定的變量(局部)只能繼承/etc/profile中的變量,他們是"父子"關系.
3 /etc/profile用于設環境變量,其他函數和別名,在/etc/bashrc里設
4 先去調用系統級的/etc/bashrc的別名和函數,然后才是 ~/.bashrc
5 bash_profile總是被設置成先讀取相同目錄下~/.bashrc的內容
aix: /etc/enviroment /etc/profile ~/.profile