There is a hidden file in your Mac’s user directory named .bash_profile. This file is loaded before Terminal loads your shell environment and contains all the startup configuration and preferences for your command line interface. Within it you can change your terminal prompt, change the colors of text, add aliases to functions you use all the time, and so much more.
If you run the open ~/.bash_profile
command and do not have a current .bash_profile, follow these steps to create one:
- Open Terminal
- Navigate to your home directory
cd ~/
- Create the file
touch .bash_profile
- Now you can use
open ~/.bash_profile
to edit your .bash_profile
open ~/.bash_profile
save your updated profile
source ~/.bash_profile
Verify what shell you are using echo $SHELL
Some output examples will be:
- /bin/csh
- /bin/bash
- /bin/ksh
Common Unix Shells
Shell Name | Summary |
---|---|
sh | original Unix shell, often call the Bourne Shell, great for scripting but lacks flexiblity and power for interactive use, doesn't have features like command completion, email checking, history, or aliasing |
csh and tcsh | often called the C shell for its syntax style, great for C programmers |
ksh, bash and zch | good blend of scripting and interactive capabilities, bash is most similar to sh, hence the Bourne Again SHell name |
Resource | Summary |
---|---|
UNIX - Visual Quickstart Guide | By Deborah S. Ray, Eric J. Ray |
About bash_profile | About bash_profile |
Add Git Branch Name to Terminal Prompt | Add Git Branch Name to Terminal Prompt |