- bash的配置文件
- 按生效范围划分,存在两类:
- 全局配置:
- /etc/profile
- /etc/prfile.d/*.sh
- /etc/bashrc
- /etc/profile
- 个人配置:
- ~/.bash_profile
- ~/.bashrc
- 全局配置:
- 按功能划分,存在两类:
- profile类:为交互式登录的shell提供配置
- bashrc类:为非交互式登录的shell提供配置
- shell登陆:
- 交互式登录:/etc/profile –> /etc/profile.d/*.sh –> ~/.bashrc –> /etc/bashrc
- 直接通过终端输入账号密码登录
- 使用“su - USERNAME”或“su -l USERNAME”切换用户
- 非交互式登录:~/.bashrc –> /etc/bashrc –> /etc/profile.d/*.sh
- su USERNAME
- 图形界面下打开的终端
- 执行脚本
- profile类:
- 全局:/etc/profile,/etc/profile.d/*.sh
- 个人:~/.bash_profile
- 功用:
- (1) 用于定义环境变量
- (2) 运行命令或脚本
- bashrc类:
- 全局:/etc/bashrc
- 个人:~/.bashrc
- 功用:
- (1) 定义命令别名
- (2) 定义本地变量
- 交互式登录:/etc/profile –> /etc/profile.d/*.sh –> ~/.bashrc –> /etc/bashrc
- 编辑配置文件定义的新配置的生效方式
- (1) 重新启动shell进程
- (2) 使用source或.命令执行进程
- 按生效范围划分,存在两类:
Linux学习笔记:bash的配置文件
原创
©著作权归作者所有:来自51CTO博客作者Ivan00745的原创作品,请联系作者获取转载授权,否则将追究法律责任
下一篇:# 第二篇博客 #
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
linux下bash配置文件詳解
linux下bash配置文件詳解
linux bas h配置 -
bash之配置文件
一、登录类型 1、交互式登录 直接通过终端输入账号和密码登录 使用 su -l USERNAME 或 su - USERNAM
profile bashrc bash配置文件 -
bash中的配置文件
这篇是谈bash配置文件的,整理了马哥所讲的内容
配置文件 bash 启动顺序 -
grafana连接钉钉频繁预警导致不发送
背景: 监控对it运维来说到底有多重要?“因为你是我的眼,让我看见这世界就在我眼前”,这是一首耳熟能详的歌曲《你是我的眼》。监控,对于it运维工程师来说就是眼睛,如果没有监控,it运维工作就无从谈起;如果没有监控,it运维工程师就成了盲人。 一个良好的监控系统可以快速地发现并定位问题,减少宕
prometheus grafana alertmanager 钉钉报警 docker