jalanb / cde

cde extends cd, historically
MIT License
2 stars 0 forks source link

Choose a specific directory from history #6

Closed jalanb closed 11 years ago

jalanb commented 11 years ago

Suppose I do

$ kd /usr/local/bin
$ ks /usr/bin

And now I want to do

$ kd -o bin

by which I mean - choose the "...bin" from history and cd there. That will always find more than 1 possibility, and choose the most recent, which will be /usr/bin. Actually I mean /usr/local/bin. At present I need to list all history, copy the full path, and "kd ". But, listing the path assigns a unique number to each path, so I should be able to use that number to

$ kd -o 2

which would bring me to the 2nd path on the list, which would be the the desired /usr/local/bin in the example