Do you constantly need to jump between different locations with very different paths. Yes, cd, cd -, and pushd/popd can help you get around sometimes. But I find that I am constantly jumping back and forth between different locations.
This is where jmp lists can help. A jmp list is simply a list of locations that you frequent often.
Creating and updating them is simple and fast. You just assign an alias to use for the location and specify the path to associate it with.
Use jmp locations to:
- keep track of your current task folders (use work, work1, etc.)
- go to common locations you fequent
- remember specific paths you don't use often
The jmp list is saved in a file in your home directory named ".jump_list.txt
". This way, the jmp list is persisted across logins.
First, you need to install jmp. This is as simple as adding a couple of script files and editing your .bashrc.
- Create a folder for your scripts:
mkdir -p ~/bin/
- Copy the scripts into this folder:
cp ~/Downloads/jmp/jmp.sh ~/bin/jmp.sh cp ~/Downloads/jmp/jmp.py ~/bin/jmp.py
- Add the following line near the bottom of you .bashrc file:
source ~/bin/jmp.sh
- You will need to source your .bashrc or log out/in for the changes to take effect.
Just type jmp to get a list of your current locations.
jmp
Also, if you type jmp and a name that does not exist, you now get the list after the error message.
hint: adds the cwd (current work directory) using the name of the folder you are currently in
jmp -a
jmp --add
By default, the folder name is used to identify the jmp location. Optionally you may provide your own name.
This version of the commands adds the current path as "myName" to your jmp list.
jmp -a myName
jmp --add myName
jmp -l
jmp --list
hint: removes the jmp list item "name" from your list
jmp -r name
jmp --remove name
jmp -h
jmp --help