The terminal isn’t the most user friendly - sensitive to errors, challenging to read, and it requires a lot of typing! I frequently find myself typing the same commands over and over into my terminal. If only there was a way to create my own shortcuts to access my main folders by typing a single keyword…
Luckily this functionality exists! Let's walk through 4 simple steps to creating your personalized bash commands:
- Navigate through your terminal to either your .bash_profile file or .bashrc depending on your operating system. Your shortcuts will live in these files so that each time you open a new terminal session, the shortcuts are accessible.
- Inside the file start creating your own commands! Use them to help you navigate to frequently accessed folders, shorten git commands, open applications, or anything you think would be helpful and time saving. Examples below:
- For best practice, after you add new commands to your shortcut file, be sure to run the command below to refresh your file via the terminal: source ~/.yourfilenamehere
- Use your commands and enjoy the time you’ve saved by working smarter - not harder! Go back and add commands as you need throughout the future.