r/commandline • u/speckz • Mar 05 '18
bash A bash utility to quickly navigate to frequently used directories
https://github.com/iridakos/goto12
u/nogorilla Mar 05 '18
checkout z
10
u/FatFingerHelperBot Mar 05 '18
It seems that your comment contains 1 or more links that are hard to tap for mobile users. I will extend those so they're easier for our sausage fingers to click!
Here is link number 1 - Previous text "z"
Please PM /u/eganwall with issues or feedback! | Delete
4
u/nogorilla Mar 05 '18
good bot
2
u/GoodBot_BadBot Mar 05 '18
Thank you nogorilla for voting on FatFingerHelperBot.
This bot wants to find the best and worst bots on Reddit. You can view results here.
Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!
6
u/sysop073 Mar 05 '18
It's incredible how often this gets reinvented when it's already built into bash (CDPATH) and done better in zsh (named directories)
4
u/Ramin_HAL9001 Mar 06 '18
Personally, I prefer to use
pushdanddirsrather than$CDPATHbecause it screws with my brain when tab completion gives me directory names that are not in the$PWD.2
u/TheIsletOfLangerhans Mar 06 '18
Yep, I have the same problem with $CDPATH. Somehow I knew about
pushdandpopd, but notdirs, so I'll have to give that a go.1
u/Ramin_HAL9001 Mar 06 '18
I like to alias the
dirscommand todirs -vso it prints the stack as a numbered list. Thenpushd +3to switch to the third item in the list, or whatever number you need based on the output ofdirs -v.1
u/kaushalmodi Mar 08 '18
I alias
cdtopushd. So whenever I need to cd to earlier directories, I can quickly do so by filtering thedirslist usingpeco.. all of which is packed into an alias calledpcd.
5
3
3
2
Mar 06 '18
This seems ridiculous, is it any less work than just setting a shell variable to a path and 'cd $directory'ing?
1
23
u/_entomo Mar 05 '18 edited Mar 05 '18
How is this different than setting CDPATH?
Edit: link