在/etc,/home/username目录的bashrc,profile文件加上以下代码,
echo `date` >> /home/zhennn/priority echo "/home/zhennn/.bashrc" >> /home/zhennn/priority echo >> /home/zhennn/priority
观察一下它们的执行顺序。
做两个操作1)打开一个终端、2)用终端登录用户(su - zhennn)
2013年 07月 18日 星期四 00:32:56 CST /etc/bash.bashrc 2013年 07月 18日 星期四 00:32:56 CST /home/zhennn/.bashrc 2013年 07月 18日 星期四 00:33:29 CST /etc/bash.bashrc 2013年 07月 18日 星期四 00:33:29 CST /etc/profile 2013年 07月 18日 星期四 00:33:29 CST /home/zhennn/.bashrc 2013年 07月 18日 星期四 00:33:29 CST /home/zhennn/.profile
所以一个用户进入一个终端时会执行一次bashrc,而且/etc先于 /home/username的。
当用户登录时profile也会被执行,同个目录中bashrc先于profile。
相关推荐
其中.bash_profile是最重要的一个配置文件,它在用户每次登录系统时被读取,里面的所有命令都会被bash执行。.profile(由Bourne Shell和Korn Shell使用)和.login(由C Shell使用)两个文件是.bash_profile的同义词,...
.bashrc .profile 该文件为Linux User目录下的.bashrc和.profile文件,用于解决①ll,la等命令的alias;②自动加载.bashrc文件。
linux下.bashrc文件修改1
/etc/bashrc 每个运行bash shell的用户都执行此文件,当bsh被打开时,该文件被读取; ~/.bash_profile 专用于本用户的shell信息,仅被执行一次; ~/.bashrc 文件包含本用户的bsh信息,登录及每次打开shell时被读取。
terminal init的时候并不会执行~/.bash_profile、~/.bashrc等脚本了, 这是因为其默认启动执行脚本变为了~/.zshrc。 解决办法就是修改~/.zshrc文件,在其中添加: source ~/.bash_profile、~/.bashrc等脚本文件...
profile和bashrc比较测试, 结论:bashrc文件可以在nologging状态下生效,而profile文件不可以
详细介绍.bash_profile和.bashrc有什么区别
vim配置文件和.bashrc
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行. 并从/etc/profile.d目录的配置文件中搜集shell的设置.
bashrc_vimrc_profile
Bash切换Zsh后,bashrc文件失效的解决方案.docx
bash-full-of-colors - 高级.bashrc和.bash_profile并拥有彩色输出
浅析linux 下的/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc
bashrc-文件-Ubuntu
安装将此 repo 作为 .bash_profile.d 或其他... 然后将 example_bash_profile.txt 作为 .bash_profile 或 .bashrc 复制到您的主目录中。 如果您没有将 repo 克隆为 bash_profile.d,则需要更改 bash_conf_dir 变量值。
IC虚拟机.bashrc和.vimrc
1 主机树梅派端使用命令vim .bashrc打开文件在文档的最下边的内容里添加 export ROS_MASTER_URL=http://主机树梅派的IP地址:11311 export ROS_IP=主机树梅派的IP地址添加完重启主机2从机端使用命令vim .bashrc打开...
bashrc 我的 Unix bashrc 文件
/etc/profile: 此文件为系统的每个用户设置环境信息,当用户... 另外,/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是"父子"关系。
linux bashrc配置