Create Aliases in .bash_profile for Common Bash Commands

InstructorCameron Nokes

Share this video with your friends

Send Tweet

.bash_profile is a file that bash invokes (or more technically sources) before the start of a new bash session. In .bash_profile, we have the opportunity to add variables, functions, and aliases to customize our bash environment and provide reusable functionality.

In this lesson, we’ll look at adding a git_sync alias as well as a ll alias. Aliases act like shortcuts and save us time and typing at the terminal. .bash_profile is a good spot for smaller functions and aliases.

Note that on most linux distributions you'll use .bashrc instead of .bash_profile.

Cameron Nokesinstructor
~ 5 years ago

Starting with Catalina, macOS now uses zsh as the default shell instead of bash. zsh and bash are very similar, but zsh looks for a .zshrc and .zprofile instead. See https://support.apple.com/en-us/HT208050 for more info on the differences between the two.