Re:How to navigate directories faster with Bash (2015)
by lloeki on Thursday April 22, 2021 @03:40AM
(#26899913)
After trying such history-based automatic tools I found they lacked predictability for me.
So the very small 50 LOC kd was born:
kd # jumps to project top level (based on .git/Gemfile)
kd foobar "$PWD" # saves an entry named foobar pointing to $PWD
kd foo # jumps to foobar
cp qux $(kd foo) # expands to foobar's value
I should probably make it expand to absolute paths so that I could change "$PWD" to .
Re:How to navigate directories faster with Bash (2015)
by pacoverdi on Thursday April 22, 2021 @11:44AM
(#26904053)
Nice, looks like mine from ~20 years ago
https://gist.github.com/pcdv/3c52d82f59fe9042793033d5e249b14...
g . # add current dir to bookmarks
g # list bookmarks
g del # open bookmarks in vi (should use $EDITOR ...)
g <regex> # jump to first matching bookmark
Wonder how many monthdays I saved compared to colleagues still navigating manually :D
Re:How to navigate directories faster with Bash (2015)
by brbsix on Thursday April 22, 2021 @03:44AM
(#26899948)
I use `autojump` (aliased as `j`), which sounds quite similar as it also records your most frequently visited directories. It's as simple as entering `j down` to enter /some/path/to/MyDownloadFolder.
For exploring massive file trees, a terminal file manager that allows you to preview the contents of subdirectories without entering them is huge time saver. I use `lf`.
Re:How to navigate directories faster with Bash (2015)
by farrelle25 on Thursday April 22, 2021 @03:56AM
(#26900047)
Autojump is great. Another similar one with less functionality but a stripped down script is "bashmarks":
Re:How to navigate directories faster with Bash (2015)
by 0mp on Thursday April 22, 2021 @04:25AM
(#26900240)
I use (and develop) `goat`. It's like a shortcut manager for aliases for directories you go to often. And a way to make "cd ...." work for any number of dots.
Re:How to navigate directories faster with Bash (2015)
by mekkkkkk on Thursday April 22, 2021 @10:29AM
(#26903150)
zsh, oh-my-zsh and z are the must haves that I add to any new environment immediately. Z and similar tools is such an elegant solution to directory navigation.
Re:How to navigate directories faster with Bash (2015)
by bamboozled on Thursday April 22, 2021 @10:46AM
(#26903356)
Same, I don't know how people do without them.
I love Z but I cannot believe there isn't something better yet?
One thing I'd love is something that helps navigating the current git project easier.
https://github.com/rupa/z