bash 配置文件
一 按生效范围划分
1.全局配置
/etc/profile
/etc/profile.d/*.sh
/etc/bashrc
2.个人配置
~/.bash_profile
~/.bashrc
按功能划分分类
profile类为交互式登录的shell提供配置
全局:/etc/profile, /etc/profile.d/*.sh
个人:~/.bash_profile
功用:
(1) 用于定义环境变量
(2) 运行命令或脚本
Bashrc类
bashrc类:为非交互式和交互式登录的shell提供配置
全局:/etc/bashrc
个人:~/.bashrc
功用:
(1) 定义命令别名和函数
(2) 定义本地变量
编辑配置文件生效
修改profile和bashrc文件后需生效两种方法:
1. 重新启动shell进程
2. source|. 配置文件
本文来自博客园,作者:45645+56,转载请注明原文链接:https://www.cnblogs.com/qiuyq/p/15975228.html

浙公网安备 33010602011771号