Bashmarks is a shell script that allows you to save and jump to commonly used directories. Now supports tab completion.
git clone https://github.com/huyng/bashmarks.gitcd bashmarksmake install- source ~/.local/bin/bashmarks.sh from within your ~.bash_profile or ~/.bashrc file
- you can now remove the downloaded
bashmarksfolder which is no longer needed
s <bookmark_name>- Saves the current directory as "bookmark_name"g <bookmark_name>- Goes (cd) to the directory associated with "bookmark_name"p <bookmark_name>- Prints the directory associated with "bookmark_name"d <bookmark_name>- Deletes the bookmarklb- Enhanced list with directory info
f <bookmark> <file>- Create file in bookmarked directoryc <bookmark> <files...>- Copy files to bookmarked directorym <bookmark> <files...>- Move files to bookmarked directorye <bookmark> <file>- Edit file in bookmarked directorylf <bookmark>- List files in bookmarked directory
b <bookmark>- Backup current directory to bookmarkr <old_name> <new_name>- Rename bookmarkt <bookmark> [name]- Create timestamped file/dir in bookmarksync <bookmark>- Sync current directory to bookmarked directory
g b[TAB]- Tab completion available for bookmarksp b[TAB]- Tab completion available for bookmarksd [TAB]- Tab completion available for bookmarks
$ cd /var/www/
$ s webfolder
$ cd /usr/local/lib/
$ s locallib
$ l
$ g web<tab>
$ g webfolder
# File operations examples
$ f webfolder index.html
$ c webfolder style.css script.js
$ sync webfolder
$ b locallibAll of your directory bookmarks are saved in a file called ".sdirs" in your HOME directory.