goto is a bash utility allowing users to change faster to aliased directories supporting auto-completion
How does it work?
User registers directory aliases, for example:
goto -r dev /home/iridakos/development
cds to that directory with:
goto comes with a nice auto-completion script so that whenever you press the
tab key after the
goto command, bash prompts with suggestions of the available aliases:
$ goto <tab> bc /etc/bash_completion.d dev /home/iridakos/development rubies /home/iridakos/.rvm/rubies
Copy the file
goto.bash somewhere in your filesystem and add a line in your
.bashrc to source it.
For example, if you placed the file in your home folder, all you have to do is add the following line to your
Change to an aliased directory
To change to an aliased directory, type:
Register an alias
To register a directory alias, type:
goto -r <alias> <directory>
goto --register <alias> <directory>
goto -r blog /mnt/external/projects/html/blog
goto --register blog /mnt/external/projects/html/blog
gotoexpands the directories hence you can easily alias your current directory with:
goto -r last_release .
and it will automatically be aliased to the whole path.
- Pressing the
tabkey after the alias name, you have the default directory suggestions by bash.
Unregister an alias
To unregister an alias, use:
goto -u <alias>
goto --unregister <alias>
goto -u last_release
goto --unregister last_release
tab key after the command (
--unregister), the completion script will prompt you with the list of registered aliases for your convenience.
To get the list of your currently registered aliases, use:
To cleanup the aliases from directories that are no longer accessible in your filesystem, use:
To view the tool's help information, use:
To view the tool's version, use:
- Fork it ( https://github.com/iridakos/goto/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Make sure that the script does not have errors or warning on ShellCheck
- Create a new Pull Request
This tool is open source under the MIT License terms.