Okay, most of us spent quite a bit of time in a terminal window, right?
Now navigating between directories in terminal can be cumbersome sometimes.
For example you want to navigate to the "Terminator" directory,
~/Downloads/Videos/Movies/Action/Terminator/
You will have to enter,
cd Downloads/Videos/Movies/Action/Terminator/
I know you can use Tab-completion but even with it you'll agree there are plenty of key-presses involved here.
Okay, now assume you are in the "Terminator" directory and you want to go back to the "Videos" directory. You'll have to do,
cd "../ ../"
See, it's cumbersome! Here is the easiest and smartest method to change directories in terminal.
First we need to install a tiny application,
sudo apt-get install go2
After the installation has completed, in your terminal run,
go2; source $HOME/.bashrc
That's it! Now you can navigate to "Terminator" directory easily like this,
go2 Terminator
Or if you are in a hurry,
Go2 Term
And from "Terminator" directory going back to the "Videos" directory is just as easy,
go2 Videos
If in hurry,
go2 Vid
Now if you have two directories "Downloads" and "Documents" and you do,
go2 Do
go2 will prompt you to select one of them,
a: ~/Documents
b: ~/Downloads
If you want to select "Documents" you need to enter "a" and for selecting "Downloads" you enter "b". Simple!!!
For more info,
man go2
Cheers!!!
Nice ... thanks for this one
Nothing like a How To to make a rainy day better!
Cheers!
only 114KB!! HA! ...
8)
Any known reason why creating an alias
alias go='go2'
would be a bad idea? Thinking in terms of scripts or any other need for 'go'
It's so addictive you might stop using good old "cd" 8)
Cheers!!!
Quote from: VastOne on March 25, 2017, 09:14:35 PM
Any known reason why creating an alias
alias go='go2'
would be a bad idea? Thinking in terms of scripts or any other need for 'go'
If someone is using Go (https://golang.org/), then it might not be a great idea :-\
Cheers!!!
Yeah.. pretty sure I will not have to worry there..
Thanks!
Quote from: VastOne on March 25, 2017, 09:23:04 PM
Yeah.. pretty sure I will not have to worry there..
Thanks!
I don't use "Go" myself so the alias works fine for me too. It removes an extra key press ;)
Cheers!!!
What have I mucked up?
All I get when running go2 is
go2 already configured, skipping.
Google does not offer a thing.. hmmm
Add following to your .bashrc,
GO2TMP=~/.go2/tmp
go2 () {
/usr/lib/go2/go2.py $*;
if [ -e $GO2TMP ]; then
cd "$(cat $GO2TMP)"
rm $GO2TMP > /dev/null
fi
}
Save the file and run,
source $HOME/.bashrc
Try go2.
Cheers!!!
I did get it to work after a dump of it and then a reinstall.. Not sure what it was but it is all good now!
That's great :)
Cheers!!!
I like goto (https://github.com/ankitvad/goto.git)
Its just a bash script really that also puts an alias in your .bashrc
I like that i'ts easy to make shortcuts to dirs but even without it's seems to know all the dirs that are there. So if I type goto .scripts, it goes into my .scripts folder in my home folder without me first making a shortcut.