DEV Community

Cover image for How to Bookmark commands in Terminal

How to Bookmark commands in Terminal

Thamaraiselvam on August 22, 2019

Always we hate to type or search or copy and paste most often used commands in the terminal. I found a great tool to ease the navigation in the te...
Collapse
 
booyaa profile image
Mark Sta Ana

This is a nice idea will give it a go. Previously in bash I’ve used the hash (comment) to tag complex commands ie ls # complex Then used CTRL-R to recall them using the tag.

Fish shell has amazing mind reading abilities too, I know it’s mostly based on frequency of command history.

Collapse
 
thamaraiselvam profile image
Thamaraiselvam

Thanks for the comment :D

Collapse
 
mauroporras profile image
Mauro Porras • Edited

If you use zsh with oh-my-zsh, the wd plugin may be of your interest: github.com/robbyrussell/oh-my-zsh/...

Collapse
 
viveksoundrapandi profile image
Vivek Soundrapandi

I use zsh z(github.com/agkozak/zsh-z), auto remembers all directory by their names. No need to explicitly book mark

Collapse
 
mitchartemis profile image
Mitch Stanley

Ooh I like this 😀, I've just found the Fish shell port as well - github.com/jethrokuan/z

Collapse
 
thamaraiselvam profile image
Thamaraiselvam

Wow, it is good. does it work with the only directory?

Collapse
 
viveksoundrapandi profile image
Vivek Soundrapandi

No it works across any directory that we have visited at least one. Cool thing is it does partial match, most cases I just type 3-4 substring of directory names.
Z dev takes me to /users/... /development directory

Thread Thread
 
thamaraiselvam profile image
Thamaraiselvam

Great

Collapse
 
mapperr profile image
Michele Perrotta

I use autojump, that, AFAIK, it's similar to z.

Collapse
 
daviddasilva profile image
David Da Silva

+1 for autojump.
Jumping to a folder named "MyFooBar" is as simple as j foo*.

(*) Provided you have been at least once in this folder before.

Collapse
 
brpaz profile image
Bruno Paz

I use fzf-marks and zsh-z for folder navigation.

For commands pet is really nice.

Collapse
 
midblue profile image
Jasper Stephenson

This is a bit off topic, but I absolutely love the typeface in your header image. Do you remember what it is? :)

Collapse
 
thamaraiselvam profile image
Thamaraiselvam • Edited

Font name: Droid Sans

Conver image Created from blogcover.now.sh/

Collapse
 
thamaraiselvam profile image
Thamaraiselvam

Thanks for the comment, pushd, popd is a stack, we can't bookmark a command in a userdefined name and also I am not sure how difficult to manage n number of commands in the stack

Collapse
 
grepliz profile image
Liz Lam

It's possible to view an indexed version of the directory stack by using dirs -v and then pop the directory by index using popd +N. But bm and to definitely feels more intuitive.

Collapse
 
rootameen profile image
Ameen Ali

when there's a folder I usually navigate to, I cd into it using full path once so that i can use ctrl+r name_of_folder for faster access next time. Works on files, too, and uses built-in cli tools.

Collapse
 
vlasales profile image
Vlastimil Pospichal

I use symlinks, CDPATH and aliases. This is enought.