原文:
http://www.linuxidc.com/Linux/2010-08/28213.htm
ubuntu不同目录下profile与bashrc的区别
/etc/profile: 此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行,并从/etc/prof
ile.d目录的配置文件中搜集shell的设置。
etc/bash.bashrc: 为每一个运行bash shell的用户执行此文件,当bash shell被打开时,该文件被读取。
~/.bash_profile: 每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次,默认情况下,他设置一些环境变量,执行用户的.bashrc文件。
~/.bashrc: 该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该文件被
读取。
~/.bash_logout: 当每次退出系统(退出bash shell)时,执行该文件。
另外,/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是"父子"关系。
~/.bash_profile 是交互式、login 方式进入 bash 运行的
~/.bashrc 是交互式 non-login 方式进入 bash 运行的
通常二者设置大致相同,所以通常前者会调用后者。
分享到:
相关推荐
详细分析了.bash_profile和.bashrc的区别
/etc/profile : 在登录时,操作系统定制用户环境时使用的第一个文件 ,此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行。
~/.bashrc:/etc/profile:/etc/vim/vimrc:/etc/bash.bashrc
ubuntuConfig 包含用于wsl ubuntu 20.04快捷方式的.bashrc,.bash_profile,.bash_aliases和.vimrc文件的存储库。
vim /root/.bashrc或/etc/profile 在最后一行增加 export PATH=/home/linux/arm-linux-gcc/bin:$PATH 重新加载环境变量 source /root/.bashrc或/etc/profile 查看是否安装成功 arm-linux-gcc –v
GOPATH是扩展库的目录,Go先搜索标准库目录,然后搜索GOPATH库目录,所有的非标准库都放在GOPATH下。以GOPATH为“/usr/local/go”目录为例子: (1)把export GOPATH=/opt/go加入到~/.bashrc(或者/etc/profile)文件...
并从 /etc/profile.d 目录的配置文件中搜集shell的设置。 /etc/bashrc: 为每一个运行 bash shell 的用户执行此文件。当 bash shell 被打开时,该文件被读取。 ~/.bash_profile: 每个用户都可使用该文件输入专...
在搜索路径中添加一些目录(可替代)-将以下行添加到主目录中“ .bashrc”的末尾(请注意该文件名开头的。。此外,这是一个隐藏文件,因此如果您使用的是文件管理器,请确保打开“显示隐藏的文件”)。 export ...
配置我的个人工作站(又名dotfiles ) 这不是普通的dotfiles项目,因为它不关心例如.bashrc,.profile和此类文件。 它专注于由于以下原因而难以处理的内容: 在标准Ubuntu频道中不存在标准的Ubuntu频道落后未打包为....
重命名您当前的 .bash_profile .bashrc .vim .vimrc 运行 setup.sh 设置 Xmonad git clone :davidbrewer/xmonad-ubuntu-conf.git ~/.xmonad ~/.xmonad/install-xmonad 设置 Emacs 这主要由 setup.sh 脚本处理; ...
安装将项目克隆到主目录中的.bash文件夹中: mkdir ~ /.bashcd ~ /.bashgit clone git://github.com/jimeh/git-aware-prompt.git 编辑您的~/.bash_profile或~/.profile或~/.bashrc (对于Ubuntu),并将以下内容添加...
与Ubuntu,Red Hat,OSX和Cygwin兼容。 GitHub Pages托管的代码段 安装 git clone https://github.com/Lucas-C/dotfiles_and_notes.git BASHRC_DIR=$PWD/dotfiles_and_notes cd $HOME for f in .colordiffrc .gemrc ...
and_wrench_selector: 指令关闭所有打开的Ubuntu窗口打开ubuntu 复制并粘贴此命令curl "https://raw.githubusercontent.com/aar9nk/terminal-files/master/{.bashrc,.git-completion.bash,.git-prompt.sh,.profile}...
在启动脚本中添加别名(例如:〜/ .bash_profile,〜/ .bashrc) echo " source ~/.aliasme/aliasme.sh " >> ~ /.bash_profile 用法 $ al add [name] [command] # add alias command with name $ al rm [name] # ...
此外,还将为本地和私有设置来源〜/ .bashrc-local和〜/ .bashrc-private 此外,还将为本地和私有设置来源〜/ .profile-local和〜/ .profile-private 还将另外获取〜/ .rosrc-local和〜/ .rosrc-private的本地和...
export OPTIX_PREFIX=/usr/local/OptiX_700 # (might need to put this in .bashrc/.bash_profile) git clone https://github.com/simoncblyth/OptiXTest git clone git@github....
Obfuscator-LLVM 4.0 BUILD ...3.修改三个目录下的setup.xml; setup.xml修改的内容如下 # # Override the toolchain prefix # ############################ old ############################ # LLVM_TOOLCHAIN_PREBUI
将以下行添加到名为.profile,.bash_profile,.bash_aliases或.bashrc的外壳程序配置文件中。 该文件位于您的主文件夹中。 $ export PATH="$PATH:~/.composer/vendor/bin" 对于Ubuntu 19+,您可能会发现您应该...
$ echo ' export PATH="$HOME/.drushenv/bin:$PATH" ' >> ~ /.bash_profile Ubuntu 桌面注意:修改你的~/.bashrc而不是~/.bash_profile 。 Zsh 注意:修改你的~/.zshrc文件而不是~/.bash_profile 。 将drushenv ...
:un-zsh的家伙.bashrc | .profile | .screenrc .bashrc | .profile | .screenrc Vim(neovim):点亮编辑器init.vim Coc:语言服务器coc-settings.json Tmux:终端多路复用器.tmux.conf | Onestatus(vim plugin...