dot files
dot files是指以.开头的文件,比如说.bash_profile。在类Unix系统下,dot files是默认隐藏的。在Shell下,很多的工具使用dot file作为默认导入的配置文件。比如说Bash对应的.bash_profile和.bashrc。在Shell下查看这些文件需要用ls -a。在你的home directory下用这个命令,你可能会看到一些已经存在的dot files。
.bash_profile & .bashrc
虽然现在我只使用zsh,但是在切换到zsh之前,积累了一些bash相关的配置,所以也在这里一并列出来。首先是这两个文件的区别:
.bash_profile 是以交互式、login方式进入bash时会调用的
.bashrc 是交互式、non-login暗示进入bash时会调用的
所以我的.bash_profile里面只有一个调用.bashrc文件的代码,所有的其他设置都放到了.bashrc里面:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
.bashrc里面主要是对一些常用的命令添加了缩写的别名,所以以前我和Eric经常会说一些黑话,比如说gps(git push),gpl(git pull)之类的,而其他人不知…
Continue Reading




