As a developer, you probably spend a decent amount of time using the terminal.

It is worth spending some time to create a development environment that will allow us to be productive and efficient.

A simple trick that can significantly affect your productivity is to create shortcuts to commands in your terminal.

These shortcuts will allow you to run commands quickly without having to remember their specific syntax. This way you can concentrate more on the important part of your work.

I use the Git Bash terminal in a Windows environment.

Creating Git Bash aliases

  1. Open ~/.bashrc or ~/.bash_profile (C:\Users\<username> folder in Windows) in your text editor (like Visual Studio Code). If you can’t find this file there, make sure the “File name extensions” and “Hidden items” options are enabled. If you still can’t find this file, create it.
  2. Add new shortcuts in the following format:
    alias shortcut_name='full_command'
    Replace shortcut_name with the name that you will actually type in the terminal. Replace full_command with the command that should run when using this shortcut.
  3. Save the file.
  4. Close and reopen the terminal for the changes to take effect.

From now on, you will only have to remember the shortcut_name instead of the full_command. Each time you type the shortcut_name in the terminal, the full_command will run.

Some shortcuts ideas

Some of the shortcuts I use a lot are navigation (cd) shortcuts.

Instead of typing the full path of the project folder, I create an alias:

alias cdsitename='cd ~/sites/sitename'

And now I only need to type cdsitename in my terminal to navigate to this folder, instead of the full command: cd ~/sites/sitename.

Another type of shortcuts I sometimes use is for Git commands, such as:

alias gs='git status'
alias gc='git checkout'
alias gl='git log'

Another useful shortcut I created is:

alias hugos='hugo server -D'

This allows me to start my local Hugo server in order to view the site.

These are just a few ideas of what can be achieved with this simple trick of creating aliases. Feel free to create shortcuts that are relevant to your workflows.