OS config
Config files
.profile
- One time config, executed when just logged in
- System wide, even accessible by GUI
- Paths
.bash_profile
is the fallback
.bashrc
- Per shell config, executed every time opening a subshell after login
Windows
Example of making a shell script:
#!/usr/bin/env sh
cd 'C:\workspace\vagrant';
vagrant up;
Shells
- Fish is the most powerful
- Bash is the most popular and stable
- Check current shell:
echo $SHELL
- Check installed shells:
cat /etc/shells
- Change default shell:
chsh --shell [shell path]
Fish
Fastest, more colorful, auto completion
https://fishshell.com/docs/current/faq.html
If default keys are weird (ctrl+left doesn’t work):
set -U fish_key_bindings fish_default_key_bindings
Zsh
Faster, more colorful, auto completion
因为 oh-my-zsh 这个配置集,它兼容 bash,还有自动补全等好用的功能。zsh 的配置文件 ~/.zshrc
Bash
Most popular