显示隐藏文件
显示隐藏文件
在终端中输代码“defaults write com.apple.finder AppleShowAllFiles -boolean true;killall Finder”即可显示隐藏文件
关闭显示隐藏文件
在终端中输代码“defaults write com.apple.finder AppleShowAllFiles -boolean false;killall Finder”即可关闭隐藏文件
Java默认安装路径
/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home
.bashrc 与.bash_profile
Linux 下
.bash_profile为login shell
// login shell 分为三种
1、命令行登录 依次会寻找一下三个文件:~/.bash_profile、~/.bash_login、~/.profile
需要注意的是,这三个文件只要有一个存在,就不再读入后面的文件了
2、ssh登录
和命令行登录情况相同
3、图形界面登录
只加载 /etc/profile 和 ~/.profile。也就是说,~/.bash_profile 不管有没有,都不会运行
.bashrc为non-login shell
用户进入操作系统以后,手动开启一个shell。这个shell就叫做 non-login shell,意思是它不同于登录时出现的那个shell,不读取/etc/profile和.profile等配置文件。
non-login shell会读入用户自己的bash配置文件 ~/.bashrc。大多数时候,我们对于bash的定制,都是写在这个文件里面的
Mac 下
Mac的Terminal打开的每个新shell默认为login shell只加载.bash_profile。而且,不管是ssh登录,还是在图形界面里启动shell窗口,都是如此
将下面的脚本加入.bash_profile
// . ~/.bashrc === source ~/.bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
或
[ -r ~/.bashrc ] && source ~/.bashrc