A Symbolic Link (symlink) is essentially a bookmark to a folder on your hard drive.
They are lightweight and disposeable.
In my workflow, I have a folder with a collection of symlinks which I use to zip around in the terminal.
This article will show the 4 steps you need to take to set it up.
1. The Folder
Make a folder in your home directory. Mine is called quicklinks.
$ cd $ mkdir quicklinks
2. Make A Link
Suppose I want to make a link to the following directory
I will call the symlink
To create a link do the following:
$ cd ~/quicklinks $ ln -s ~/Code/Projects/Personal/blog post
Notice the format of the command.
lnstands for link
-smeans symbolic, so
ln -smeans symbolic link
- Then you specify the folder you want to make the link of (
- Finally give the link a name (
ln -s target_dir name
3. Setup an alias
To make this work as efficient as possible, I created an alias
This alias will change into the quicklinks directory and list its contents.
If you have a
bashrc, or some other place to add an alias put it there.
Add the following:
$ nano ~/.bash_profile
Once you do that you are good to go, just issue the
[bash_profile] alias q='cd ~/quicklinks; ls`
read here if you need more information on how make an alias / where to put it.
4. The final product
Assume we are using the same folder as before (
Create the link
$ q docs work carbon testing books lyrics $ ln -s ~/Code/Projects/Personal/blog post
Using the link
$ q $ cd post
I have some symlinks that are permanent.
Others get created to be used just for the current context, and I prune them out later.
I use 0-9 to prefix the most used symlinks, so I can quickly move to them.
0_dotfiles is the first symlink I have.
When I want to go to my dotfiles I do this:
$ q $ 0[Tab] => $ 0_dotfiles