Table of Contents

Quick Guide to Symbolic Links (symlinks) on Windows or Linux

Do you want to access folders and files from different locations without maintaining duplicate copies? You can use Symbolic Links to link anything in Windows 10, 8, 7, Vista, XP, and GNU/Linux.

Symbolic links, also known as symlinks, are basically fancy shortcuts. You can create symlinks to individual files or folders, and then these will appear like they are stored in the folder with the symbolic link even though the symbolic link only points to their real location. There are two types of symbolic links:

The mklink command on Windows 10
Newer versions of windows use symbolic links to keep compatibillity with older directory structure. For example, Documents and Settings Symlink points to the Users folder

Caution: Make sure to never create a symbolic link inside of a symbolic link. For instance, don’t create a symbolic link to a file that’s contained in a symbolic linked folder. This can create a loop, which can cause problems you don’t want to deal with.

In Windows 10, 8, 7, or Vista

In Windows, use the mklink command to create symbolic links. Open an administrator Command Prompt.

For example, if we wanted to create a symlink on Desktop that points to my archives located on the D drive, enter the following in command prompt:

c:\>mklink /J C:\Users\username\Desktop\Archives d:\archives
Junction created for c:\Users\username\Desktop\Archives <<===>> d:\archives

Note: The first path was to the symbolic folder I wanted to create, while the second path was to the real folder. Note: If your path has spaces in it, use quotes. (“c:\personal folders\etc”)

Note: Be careful when deleting directory symlinks. ‘Del’ command will delete the contents of the directory. For a symlink to a directory made with mklink /d or mklink /J, use rmdir instead.

Unix-based operating systems have supported symbolic links since their inception. Open terminal and enter the following:

ln -s /home/username/archives /home/username/Desktop/Archives

Note: This is opposite of the Windows commands; you put the source for the link first, and the destination path second.

Conclusion

Symbolic links are very handy, and we can use them to stay organized.

Do You usesymlinks in a clever way? Tell us about it in the comments below.