Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd, 2017 please sign up again. Thanks!

  1. Note: we recently updated out site software, please report any unseen issues - we do this often to insure your information is secure.
    Dismiss Notice

goto - a bash utility to navigate to aliased directories

Discussion in 'Command Line' started by iridakos, Mar 6, 2018.

  1. iridakos

    iridakos New Member

    Joined:
    Jan 28, 2018
    Messages:
    11
    Likes Received:
    9
    Hello everybody,



    I published a bash utility named goto. The tool allows users to navigate to directories using an alias that was previously explicitly defined.

    Its best feature is the autocomplete functionality making navigation pretty fast.

    [​IMG]

    Example
    A user may register a directory with:
    Code:
    goto --register workdir /mnt/development/a/really/long/directory
    Then, after typing this:
    Code:
    goto <tab>
    bash provides a list of all registered aliases allowing autocompletion based on user's input.

    You can find the code and installation guides on GitHub: https://github.com/iridakos/goto
     
    atanere and JasKinasis like this.
  2. JasKinasis

    JasKinasis Well-Known Member

    Joined:
    Apr 25, 2017
    Messages:
    243
    Likes Received:
    440
    Nice - I'd never considered doing something like that. That's a brilliant idea!

    I usually set up aliases in my .bashrc to cd into my most commonly used directories.

    The code is really clean too.
    Makes mine look like a complete mess! XD

    [edit]
    And it works well in Cygwin on my Windows PC at work!
    [/edit]
     
    atanere and iridakos like this.
  3. iridakos

    iridakos New Member

    Joined:
    Jan 28, 2018
    Messages:
    11
    Likes Received:
    9
    @JasKinasis Thanks! I really appreciate the feedback "works well in Cygwin on my Windows PC", that's awesome :D

    I haven't seen your code yet but note that this is a pretty straightforward and simple script. Your's has more logic than this!
     
    JasKinasis likes this.
  4. JasKinasis

    JasKinasis Well-Known Member

    Joined:
    Apr 25, 2017
    Messages:
    243
    Likes Received:
    440
    It works well on my personal laptop too - running Debian.

    Sadly I am forced to use Windows at work. Cygwin allows me to maintain my sanity, by giving me access to all of my favourite Linux tools. I couldn't survive if I had to deal solely with cmd, powershell and Visual Studio. So I try to do as much work as possible in Cygwin! XD

    I only use Visual Studio for the debugger and the less said about cmd and powershell - the better!
     
    iridakos likes this.
  5. iridakos

    iridakos New Member

    Joined:
    Jan 28, 2018
    Messages:
    11
    Likes Received:
    9
    Cool, I totally understand you!
     

Share This Page