Skip to content

Instantly share code, notes, and snippets.

@protrolium
Last active March 25, 2020 19:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save protrolium/03f7e9226331a6dd553856e51bdd1fee to your computer and use it in GitHub Desktop.
Save protrolium/03f7e9226331a6dd553856e51bdd1fee to your computer and use it in GitHub Desktop.
custom aliases

I decided that I wanted to use aliases to quickly navigate to directories.
Inside a directory I have called scripts I create each one:

nano myAlias

#!/bin/bash
# file : /scripts/myAlias
#
cd /directory/that/i/want

Exit, save and repeat for each alias you want to create.


Then create a new file, mastercode.sh (I also include it inside of scripts).

nano mastercode.sh

#!/bin/bash
# file : /scripts/mastercode.sh
#
alias='. path/to/scripts/myAlias1'
alias='. path/to/scripts/myAlias2'
alias='. path/to/scripts/myAlias3'

for as many aliases as you have made, etc. Syntax is important here, as there is a space between the dot . and path: alias='. path/'


Finally, I include at the end of my ~/.bashrc

source path/to/scripts/mastercode.sh

@mashdot
Copy link

mashdot commented Mar 25, 2020

Have you heard of "autojump"? https://github.com/wting/autojump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment