New Mac Setup
Install & activate updated bash
echo $BASH_VERSION
brew install bash
homebrew installs the updated bash into usr/local/bin/bash
sudo bash -c "echo $(brew --prefix)/bin/bash >> /private/etc/shells"
note that #(brew --prefix)
is usually usr/local/bin
but using the variable is safer
cd /etc
cat shells
cd /private/etc
cat shells
the last line should read
/usr/local/bin/bash
chsh -s /usr/local/bin/bash
If you go to System Preferences > Users & Groups > User > click the lock to make changes _ right click on the user name & choose “Advanced”, the login shell for the user should now read /usr/local/bin/bash_
Restart terminal.app (new window works too) or iTerm
echo $BASH && echo $BASH_VERSION
brew cask install iterm2
# enable "tap":
brew tap caskroom/fonts
# install the fonts
brew cask install font-source-code-pro
brew cask install font-anonymous-pro
brew cask install font-hack
0cd00c
– or start with normal Dark and set foreground colour to 00c200
touch .bash_profile
This will be empty except for a reference to load .bashrc. Contents of the file:
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc
touch .bashrc
This will be empty except for references to load the environment variables, aliases, customised prompt, useful functions, and config for python virtualenvs. Contents of the file:
# Load .env if it exists
test -f ~/dotfiles/.env && source ~/dotfiles/.env
# Load .aliases if it exists
test -f ~/dotfiles/.aliases && source ~/dotfiles/.aliases
# Load .prompt if it exists
test -f ~/dotfiles/.prompt && source ~/dotfiles/.prompt
# Load .functions if it exists
test -f ~/dotfiles/.functions && source ~/dotfiles/.functions
# Load .venvsconf if it exists
test -f ~/dotfiles/.venvsconf && source ~/dotfiles/.venvsconf
dotfiles folder:
– Create the folder: mkdir dotfiles
– Create the files in this folder:
touch .env
touch .aliases
touch .prompt
touch .functions
touch .venvsconf
ln -s .aliases /target_folder/dotfiles/dot_aliases
ln -s .env /target_folder/dotfiles/dot_env
ln -s .functions /target_folder/dotfiles/dot_functions
ln -s .prompt /target_folder/dotfiles/dot_prompt
ln -s .venvsconf /target_folder/dotfiles/dot_venvsconf
brew install bash-completion
/dotfiles/.env
file:
# Add tab completion for many Bash commands
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
pyenv
brew install openssl
brew install readline
brew install xz
brew install tree
brew install ccat