What a symbolic link is and why you might want one
A symbolic link (or symlink) is a shortcut that points to a file or folder somewhere else on your computer. Unlike a regular shortcut, a symlink acts like the original file itself — programs see it as the real thing, not as a pointer to the real thing. When you open a symlink, you're opening the original. When a program writes to a symlink, it writes to the original file.
The main reason to create one is to keep files in two places without duplicating them. You might have a folder buried deep in your system that a program needs to read from, but you want quick access from your desktop. A symlink lets you do that. Another common use: you have files on an external drive or network location, and you want them to appear inside a folder where your backup software or another program expects to find them.
Symlinks are different from the shortcuts your operating system creates by default. A Windows shortcut is just a pointer file that Windows knows how to follow. A symlink is recognized by programs themselves, which makes it more powerful but also means you need to create it from the command line or a specialized tool rather than right-clicking.
Key Takeaways
- A symbolic link makes a file or folder appear in a second location without copying it, so changes to the original show up everywhere.
- On Windows 10 and later, you can create a symlink using the mklink command in Command Prompt or PowerShell, or use a graphical tool like Link Shell Extension if you prefer not to use the command line.
- On Mac and Linux, use the ln -s command in Terminal to create a symlink, specifying the original file path and the location where you want the link to appear.
- Symlinks can break if you move or delete the original file, so keep the original in a stable location and move the symlink instead if you need to reorganize.
- Some programs and backup tools do not follow symlinks by design, so test your setup before relying on it for important workflows.
Creating a symlink on Windows
On Windows 10 and later, the built-in way to create a symlink is through Command Prompt or PowerShell using the mklink command. Open Command Prompt as Administrator (right-click Command Prompt in the Start menu and select "Run as administrator"). Then type the command in this format:
mklink /D "C:\path\to\link" "C:\path\to\original"
Replace the paths with your actual locations. The /D flag creates a link to a folder; omit it if you're linking to a single file. The first path is where you want the symlink to appear, and the second is the original file or folder. If either path contains spaces, wrap it in quotation marks as shown. After you press Enter, you should see a message confirming the symlink was created.
If you prefer a graphical interface, download and install Link Shell Extension from the Windows Store or from its project page. Once installed, right-click any file or folder, select "Pick Link Source", then navigate to where you want the link and right-click again to select "Drop As... Symbolic Link". This avoids the command line entirely.
Creating a symlink on Mac and Linux
On Mac and Linux, open Terminal and use the ln command with the -s flag (the s stands for symbolic). The format is:
ln -s /path/to/original /path/to/link
For example, if you have a folder called Documents in your home directory and you want a symlink to it on your Desktop, you would type:
ln -s ~/Documents ~/Desktop/Documents
The first path is the original file or folder (use the full path or a path relative to your current location). The second path is where you want the symlink to appear. After you press Enter, the symlink is created. You can verify it worked by typing ls -l in the directory where you created the link; symlinks show up with an arrow pointing to the original.
Checking that your symlink works
After you create a symlink, test it by opening it the way you normally would. If it's a folder, double-click it and verify that you see the contents of the original folder. If it's a file, open it with the program that normally opens that file type. The symlink should behave exactly like the original.
On Windows, you can also right-click the symlink and select Properties to see the path it points to. On Mac and Linux, use the command ls -l to see the arrow notation showing where the link points. If the symlink shows a broken arrow or you get an error when you try to open it, the original file or folder may have been moved or deleted.
What happens if you move or delete the original file
A symlink is only a pointer. If you delete the original file or folder, the symlink breaks and becomes useless. If you move the original to a different location, the symlink stops working unless you update it to point to the new location.
To avoid this, keep the original file in a stable location and move the symlink instead if you need to reorganize. If you do move the original, you can delete the broken symlink and create a new one pointing to the new location. On Windows, use mklink again. On Mac and Linux, delete the old link with rm and create a new one with ln -s.
Programs that do not follow symlinks
Most modern programs follow symlinks without any issue, but some do not. Backup software sometimes skips symlinks by design to avoid backing up the same file twice. Some security software may block symlinks. A few older programs simply do not recognize them.
Before you rely on a symlink for an important workflow, test it with the specific program you plan to use. Open the program, navigate to the symlink, and verify that it can read or write to it. If the program ignores the symlink or gives an error, you may need to use a different approach, such as moving the file itself or using the program's built-in options for adding external locations.
Frequently Asked Questions
Can I create a symlink to a file on an external drive or network location?
Yes, but the link will break if the external drive is unplugged or the network location goes offline. The symlink itself is just a pointer, so it needs the original to be accessible. This works well for external drives you keep connected, but for portable setups, consider whether a regular copy or a different approach might be more reliable.
What is the difference between a symlink and a hard link?
A hard link points directly to the file's data on disk, so it works even if the original is moved or renamed. A symlink points to a file path, so it breaks if the path changes. Hard links only work for files, not folders, and they are less portable across different drives. For most everyday use, symlinks are what you want.
Can I create a symlink to a symlink?
Yes, you can chain symlinks together, but this creates unnecessary complexity and makes it harder to troubleshoot if something breaks. If you need a symlink to point somewhere, point it directly to the original file or folder rather than to another symlink.
Do symlinks work the same way on Windows, Mac, and Linux?
They work the same way in principle, but the command-line syntax is different. Windows uses mklink, while Mac and Linux use ln -s. Some older versions of Windows require administrator privileges or special settings to create symlinks, so if the mklink command does not work, check your Windows version and user permissions.