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

相关推荐
取经蜗牛2 小时前
Ubuntu 国内镜像源配置指南(多版本常用镜像地址都有)
linux·运维·ubuntu
实心儿儿4 小时前
Linux —— 线程控制(1)
linux·运维·服务器
筠筠喵呜喵4 小时前
Linux软件开发性能优化
linux·c++·性能优化
Bruce_kaizy4 小时前
c++ linux环境编程——文件io介绍以及open 、write 、read 三剑客深度详解
linux·服务器·c++·ubuntu·操作系统·文件io
亦良Cool5 小时前
VMware虚拟机ubuntu瘦身,解决虚拟机越用越大
linux·运维·ubuntu
星辰&与海6 小时前
KVM + QEMU虚拟化方案
linux·运维
宋浮檀s6 小时前
应急响应——恶意流量&攻击行为识别
linux·运维·网络·网络安全·应急响应
REDcker6 小时前
Linux OverlayFS详解
java·linux·运维
lwx9148527 小时前
Linux系统中用户锁定后如何解锁
linux·运维·服务器
zhangrelay8 小时前
ROS 2 Lyrical Luth启程-Ubuntu26.04-
linux·笔记·学习·ubuntu