We explored go2 in one of our earlier articles on faster terminal navigation. However, alternatives galore in the cmdline world and developers come up with new solutions now and then. We found goto and shmark, two more tools to navigate efficiently using bookmarks.
Saves directories as bookmarks (or shortcuts) and does a fuzzy search to find files and directories. The bookmarks are save under ~/.GOTO directory as plaintext files. For example, the bookmark work will be saved as work.skt. As you might have guessed this works like symbolic links and we think a sorted structure or single file based implementation would have been faster for navigation. Anyway, it’s still handy and the fuzzy search logic is distinct from the navigation logic.
Run the following commands to install goto:
$ git clone https://github.com/ankitvad/goto.git $ cd goto $ make install
- goto a bookmark or absolutelocation
$ goto <bookmark> $ goto <location>
- Save the current directory as bookmark
$ goto -s
- List all save bookmarks
$ goto -l
- Delete a saved bookmark
$ goto -d
- Print the absolute path for a bookmark
$ goto -p
- Fuzzy find files/directories matching regex in current directory
$ goto -f
Another minimal bookmarking tool that uses a single file based approach to record the bookmarks.
$ git clone https://github.com/charles-l/shmark.git $ cd shmark $ chmod +x shmark.sh $ sudo mv shmark.sh /usr/bin/
You need to source the shmark.sh file (check below) to run the commands. Assuming that you have saved the file in /usr/bin/ as above the command to source the file is:
$ source /usr/bin/shmark.sh
You may want to add the command in ~/.bashrc to source the file when you run your terminal.
- To add a bookmark for the current directory
$ m <bookmark>
- To cd to a bookmark
$ g <bookmark>
- Save all bookmarks to ~/.shmarks
Note that sourcing shmarks.sh is necessary to load all saved bookmarks.