raphael / gcd

Smart (?) cd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gcd

Recurse through $HOME/src/go/src, finds the first file / directory that matches the given argument and prints it.

e.g.:

$ gcd gcd
/Users/raphael/src/go/src/github.com/raphael/gcd

Usage

In your .bashrc, .bash_profile or equivalent:

function cdg() {
   cd `gcd $1`
}

Then:

~ $ cdg gdc
~ src/go/src/github.com/raphael/gcd

About

Smart (?) cd


Languages

Language:Go 100.0%