Skip to content
Mathias Gelhausen edited this page Aug 6, 2015 · 3 revisions

"go" is a bash function that creates and manages directory shortcuts.

Its purpose is to be able to quickly navigate to often used directories without Defining aliases each time in your .bashrc

Installation

source the file "functions/go.func"

. functions/go.func
source functions/go.func

For permanent availability include the above statement in your .bashrc

Usage

Summary

  go                                     # List all defined shortcuts and let you quickly choose
                                         # a shortcut.

  go -l                                  # List all defined shortcuts without the quick selection 
                                         # prompt

  go + demo                              # adds a shortcut to the current directory
                                         # with the name "demo"

  go + test /some/very/often/used/dir    # adds a shortcut to the given directory
                                         # with the shortcut "test"

  go test                                # jumps to the directory with the shortcut name "test"
  go te                                  # jumps also to test, because partially typed
                                         # names are resolved using the first match in list
                                         # Except if there are more than one shortcut starting with
                                         # "te". In that case all matching shortcuts are listed
                                         # and the selection prompt is displayed.


  go demo                                # jumps to the directory defined under "demo"

  go - test                              # deletes shortcut "test"

Listing available shortcuts

## If there are no shortcuts....
> go
no shortcuts.

--
> go

  1) demo       /home/mathias/demo/directory/shortcut
  2) temp       /home/mathias/temp
  3) test       /home/mathias/temp/go.test

Go to? 

--
> go -l

  1) demo       /home/mathias/demo/directory/shortcut
  2) temp       /home/mathias/temp
  3) test       /home/mathias/temp/go.test


--
> go te

  1) temp       /home/mathias/temp
  2) test       /home/mathias/temp/go.test

Go to? 2
Go to /home/mathias/temp/go.test

Clone this wiki locally