/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.并从/etc/profile.d目录的配置文件中搜集shell的设置.
当用root之外的其他用户登陆时,执行ls -a
会出现以下文件:
.bash_profile和.bashrc
~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取.
~/.bash_logout:当每次退出系统(退出bash shell)时,执行该文件.
另外,/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是"父子"关系.
~/.bash_profile 是交互式、login 方式进入 bash 运行的
~/.bashrc 是交互式 non-login 方式进入 bash 运行的
通常二者设置大致相同,所以通常前者会调用后者。
示例:
su - root;
cd ~;
vi .bashrc 添加export JAVA_HOME=123123
source .bashrc;
分享到:
相关推荐
.bashrc .profile 该文件为Linux User目录下的.bashrc和.profile文件,用于解决①ll,la等命令的alias;②自动加载.bashrc文件。
详细介绍.bash_profile和.bashrc有什么区别
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行. 并从/etc/profile.d目录的配置文件中搜集shell的设置.
1.上面这三个文件是bash shell的用户环境配置文件,位于用户的主目录下。其中.bash_profile是最重要的一个配置文件,它在用户每次登录系统时...但一般 来说都会在.bash_profile里调用.bashrc脚本以便统一配置用户环境。
profile和bashrc比较测试, 结论:bashrc文件可以在nologging状态下生效,而profile文件不可以
ubuntuConfig 包含用于wsl ubuntu 20.04快捷方式的.bashrc,.bash_profile,.bash_aliases和.vimrc文件的存储库。
bash-full-of-colors:高级.bashrc和.bash_profile以及彩色输出
浅析linux 下的/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc
bash-full-of-colors - 高级.bashrc和.bash_profile并拥有彩色输出
1)修改/etc/profile文件 推荐使用这种方法,因为所有用户的shell都有权使用这些环境变量,缺点是可能会给系统带来安全性问题。 这里是针对所有的用户的,所有的shell; [root@test ~]# vim /etc/profile …. expo
详细分析了.bash_profile和.bashrc的区别
/etc/profile 每个用户,首次登录时被执行; /etc/bashrc 每个运行bash shell的用户都执行此文件,当bsh被打开时,该文件被读取; ~/.bash_profile 专用于本用户的shell信息,仅被执行一次; ~/.bashrc 文件包含本...
terminal init的时候并不会执行~/.bash_profile、~/.bashrc等脚本了, 这是因为其默认启动执行脚本变为了~/.zshrc。 解决办法就是修改~/.zshrc文件,在其中添加: source ~/.bash_profile、~/.bashrc等脚本文件...
bashrc_vimrc_profile
方法一:通过修改.bashrc或.bash_profile文件来实现 通过修改home目录下的.bashrc或.bash_profile文件来实现。这两个文件选择其中一个在末尾加入如下一行,具体操作如下: [GeekDevOps@GeekDevOps /]$ cd ~ ...
:un-zsh的家伙.bashrc | .profile | .screenrc .bashrc | .profile | .screenrc Vim(neovim):点亮编辑器init.vim Coc:语言服务器coc-settings.json Tmux:终端多路复用器.tmux.conf | Onestatus(vim plugin...
点文件 安装vim插件的步骤: 光盘〜 运行:git clone :tabletenniser / dotfiles.git 对于只读存储库,请使用ssh:... 设置.bashrc,.bashprofile,.gitconfig,.dircolors的步骤: ln -s〜/ dotfiles / .bashrc〜/
安装将此 repo 作为 .bash_profile.d 或其他... 然后将 example_bash_profile.txt 作为 .bash_profile 或 .bashrc 复制到您的主目录中。 如果您没有将 repo 克隆为 bash_profile.d,则需要更改 bash_conf_dir 变量值。
.abcuser.dict .bashrc .Desktop_gb .kderc .Xdefaults .abcuser.rem .cshrc .gnome .lynx_cookies .bash_history Desktop .gnome-desktop .sawfish 3、-A 显示所有文件和目录(它比-a少显示.和..两项)。 4、-l ...