Liunx登录时相关bash配置文件(登录脚本)

profile类的文件:设定环境变量,运行命令或脚本

bashrc类的文件:定义命令别名

全局配置:

/etc/profile

/etc/profile.d/*.sh

/etc/bashrc

个人配置文件:

~/.bash_profile

~/.bashrc

用户登录时加载bash配置文件的过程,从开始到登陆的两种方式,再到登出。

开机执行脚本: /etc/rc.local

登陆式(输入用户密码式)执行的顺序:

/etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bash_login --> ~/.bashrc --> /etc/bashrc

或

非登录式(临时切换,没输入密码)执行的顺序:

~/.bashrc --> etc/bashrc

退出时执行文件: ~/.bash_logout

相关推荐
qeen872 小时前
【Linux】线程的基本认识及与进程的关系、对比
linux·运维
疯华整猫3 小时前
一条 kill -9 杀不掉的进程:AI 时代,程序员为什么必须精通 Linux
linux
爆米花byh5 小时前
在RockyLinux9环境下安装Rust1.100.0环境
linux·rust
爆米花byh5 小时前
在RockyLinux9环境下安装Manticore Search32.1.3单机版
linux·服务器·搜索引擎
大今野5 小时前
技能六 · Linux(CentOS 7)操作系统章节习题
linux·运维·centos·专转本
我命由我123456 小时前
Android Gradle - Android Gradle 配置
android·java·linux·java-ee·kotlin·android studio·android-studio
机智阳6 小时前
系统优化(高级)
linux·运维·编辑器
.道阻且长.6 小时前
Linux基础IO:缓冲区 和 库函数的实现
linux·运维·服务器
皓月盈江7 小时前
Windows 复制文件夹到 Linux 后显示“带锁”解决方法
linux·运维·windows·linux文件·文件带锁·文件夹带锁
byte轻骑兵7 小时前
异构混合环境远程控制工具适配对比(Windows / Mac / Linux / 国产系统 / arm64 / 鸿蒙)
linux·windows·macos·远程办公