Symbolic Links are quite useful because they allow us to store files wherever we want, regardless of a program’s need to store them in a particular place.
I’ll be giving an overview of everything about symbolic links. The links are quite easy to create too. There are a few ways to do that, and I’ll also explain those ways in easy-to-follow steps below.
Symbolic Links: What Are They? 🤔
These links represent actual files or folders. Normally, shortcuts take you to where files, apps, or folders are located. But these links stand in as the files and folders themselves.
When you create a symbolic link to a folder, there is no difference between clicking that folder or clicking the link.
This feature is why most folks call them “advanced shortcuts”. These links can be useful in many situations such as the one below.
Example
Let’s say you have a warfare app that needs its files stored in a particular directory (say C:\Warfare). But you want to declutter that particular directory and there’s nothing else you can afford to remove except the files for the app.
What you’ll do is move the app’s directory to another directory (say D:\GamesFolder), then all you’ll have to do is create a symbolic link at C:\Warfare that will point to D:\GamesFolder.
What now happens is that whenever you try to launch your app, it’ll naturally go to C:\Warfare and then get directed back to D:\GamesFolder for the files by the symbolic link you created.
All of these processes will be done without any delay and the app will still believe that its files are stored in its preferred location. Sounds cool, right?
Other Reasons For Using Symbolic Links
You can use the links for a variety of reasons. It also helps when working with programs like Google Drive.
You can sync folders Google Drive using the links even if the files and folders aren’t located in their own folder (something most apps insist upon before syncing).
You don’t have to worry about symbolic links taking up double the memory space too. The links are virtual folders (contain nothing more than code that maintains an appearance of the folder or files you linked).
It is also important to know that not only Windows 10 supports symlinks. Windows Vista, 7, 8 versions also support symbolic links.
The Two Types Of Symbolic Links
The generally known names for the two types of links that exist are hard links and soft links. But I need to point out that Windows refers to soft links as symbolic links.
So, in any Windows document, you’d see the two types of links as hard links and symbolic links.
To ensure better understanding, I will stick to the hard and soft links naming as I explain their uses and differences.
Soft (Symbolic) Links
Soft links redirect queries to where the actual files or folders exist.
So if you click on a soft link to get the files of a program, you’ll be taken to where the files of that program exist.
Hard Links
Hard links are quite different and more intense. These links don’t redirect queries.
When you click on them, the links act as if the files and folders you’re looking for are exactly in the link (hard) you clicked on.
This is what makes apps and programs not know any better that their files or folders have been moved from preferred storage locations to other directories.
Creating Symbolic Links In Windows
Learning how to create symbolic links just needs a little basic knowledge about systems and using command prompts.
You can create symbolic links using the two ways explained below.
The first one is internally sourced while the second option involves downloading a graphical tool that would make the job a whole lot faster and probably easier especially for folks who aren’t tech-savvy.
If you’re not comfortable with downloading 3rd party tools, then you should just stick to the first option.
Creating Symbolic Links Using The mklink Command
The first step is opening a command prompt with administrator privileges.
There’s a Windows 10 update (Creator’s Update) that allows you to use the command prompt (without admin privileges) for something like this but you’ll have to enable developer mode first.
To enable the mode, follow this navigation.
Settings > Update & Security > For Developers
If you want to avoid all the steps above, just go to your Start menu and look for the Command Prompt shortcut, right-click the shortcut and then choose Run As Administrator in the pop-up menu that appears to launch the prompt window.
Note: If you don’t run the command prompt with admin privileges when you get to enter the command, you’ll get a message saying you don’t have sufficient privilege to perform the operation.
Creating a Soft Link Pointing To a File
This command creates a soft link at Link that points to the file at Target.
mklink Link Target
Creating a Soft Link Pointing To a Directory
This command creates a soft link too but one that points to a directory at Target.
mklink /D Link Target
Creating a Hard Link Pointing To a File
This hard link command creates a link at Link that points to a file at Target.
mklink /H Link Target
Creating A Directory Junction
A directory junction just basically means creating a hard link pointing to a directory.
mklink /J Link Target
These are the commands you need to create symbolic links using the mklink command.
Example
I’ll give an example of how a command will look below. I’m going to try and create a directory junction.
mklink /J C:\Warfare C:\GamesFolder
Please note that when you have paths that have spaces, you will need to tweak your command by adding apostrophes. Here’s an example below.
mklink /J “C:\War fare” “C:\Games Folder”
Creating Symbolic Links With This 3rd Party Graphical Tool (Link Shell Extension)
The first step is downloading a package needed for the tool to run effectively. You should download the package first even before the tool.
Both of these files (package + tool) can be found on the download page.
When you’re done with downloading and installing the tool. Launch it.
You’ll see the option to access your files and folders. Do that and navigate to the file or folder you want to create a link to.
When you find the file or folder, hover on it and right-click. In the pop-up menu, select the option that reads Pick Link Source.
Now go to the file or folder you want to create the link to. When inside, use the Drop As option to create a link to the file or folder you earlier selected in this new file or folder you chose.
There are three options for you to choose from when you click on Drop As.
- Hardlink – Creating a hard link to a file.
- Junction – Creating a hard link to a directory.
- Symbolic Link – Creating a soft link to both files and directories.
Using a third-party graphical tool to create links is quite straightforward. The important thing is to know the functions of the menu (as outlined above).
There are always security concerns whenever you want to download third-party apps and you should know that you are open to a level of risk (minimal in this case).
You will get a warning that this third-party tool download can’t be done securely and your Windows Defender might even tell you it’s unsigned.
If you choose to, still go ahead and download it.
Deleting Symbolic Links In Windows
This is quite easy to do. You can delete it by right-clicking on the link and selecting the Delete option in the pop-up menu that appears.
Just like you would delete any file or folder, you could use shortcut keys too. Select a link and click Delete.
But I have to warn you about the danger of deleting the actual files or folders instead of the link (especially in cases of hard links).
These links fool applications. If you’re not careful they might trick you into deleting files or folders too.
You might want to double-check which one’s the Link and which one’s the Target first before deleting anything.
Creating Symbolic Links In Linux (For Files)
Creating links in Linux relies on ln and -s (used in choosing which symbolic link). The format below is quite easy to follow.
ln -s [target file] [symbolic filename]
In – This command creates links between source files and directories
-s – This is the command for specifying the type of command you want.
Target File – This is the file you’re creating a link for.
Symbolic Filename – Named symbolic because it will act as the target file itself but is just a link.
Verifying created links by directory listing is done by using the detailed list command.
ls -l
In cases where you don’t input any symbolic filename, the link will still be created. But it will be created in the same directory as the target file.
Creating Symbolic Links In Linux (For Folders)
The idea here too is similar to creating symlinks in the files above. Here’s the basic format to follow.
ln -s [specific file or directory] [Symlinks name]
All you have to do is input the directory you want to create a link to and input the name of the link you want to create, then run the command.
Example
ln -s /user/local/download/fm /games
In this command line above, I’m trying to link the /user/local/download/fm directory to the /games folder.
Once the link is created in the /games folder, any attempt by programs to access the directory in the folder will work as if the directory is in the folder.
The More Common Symbolic Link Options (Linux)
Below is a list of some of the useful symbolic link options that users might want to try out.
Please note that Symbolic Links are also called command-line switches.
- -backup[=CONTROL] – this command backs up the existing destination files.
- -f, –force – this command removes existing destination files.
- -L, –logical – this command dereference symbolic link targets.
- -d, -F, –directory – gives super users the privilege of attempting hard links.
- -l, –interactive – this is a prompt before destination files are removed.
- -r, –relative – this helps in creating a link that is relative to the link location.
- -n, –non-dereference – symbolic links to the directory are taken as files.
- -s, –symbol – This ensures symbolic, not hard, links are created.
- -P, –physical – making hard links to symbolic links directly.
Removing Symbolic Links In Linux
There are two ways you could change or remove symbolic links in Linux. Both ways are easy to follow.
- By the unlink command
- By the rm command
Using The Unlink Command
This way of removing symbolic links in Linux is straightforward.
All you have to do is follow the format (command) below whenever you’re trying to remove the links.
unlink [symbolic link to remove]
To follow this format with an actual link, all you have to do is input the symbolic link’s name (the one you used in creating the link).
Using The rm Command
This is also similar to the command above, they basically both do the same thing. Here’s the format below.
rm [symbolic link to remove]
What is a symbolic link example?
Example 1:-
Here is an example of how to create a symbolic link in a Linux/Unix-based operating system:-
Let’s say you have a file located at /home/user/documents/report.txt, but you want to access it from another directory, say /home/user/downloads/. You can create a symbolic link to the file using the ln command with the -s flag, like this:-
ln -s /home/user/documents/report.txt /home/user/downloads/report_link.txt
This creates a symbolic link named report_link.txt in the downloads directory that points to the original file in the documents directory. You can now access and manipulate the file using either the original path or the symbolic link.
Example 2:-
Here’s an example of how to create a symbolic link using the ln command in a Linux terminal:-
Suppose you have a file called file1.txt located in /home/user/documents/.
To create a symbolic link for file1.txt in your home directory, you would use the following command:
ln -s /home/user/documents/file1.txt ~/file1_link
This creates a new file called file1_link in your home directory that points to the original file1.txt file. The -s option tells the ln command to create a symbolic link instead of a hard link.
You can now access the contents of file1.txt by opening file1_link. Any changes made to file1.txt will also be reflected in file1_link, and vice versa.
Example 3:-
Here’s an example of how to create a symbolic link in Unix-based systems, such as Linux or macOS:
Suppose you have a file called “mydocument.txt” in the directory “/home/user/documents/”, and you want to create a symbolic link to this file in the directory “/home/user/downloads/”. You can do this using the following command in the terminal:
ln -s /home/user/documents/mydocument.txt /home/user/downloads/mydocument_link
Now you can access the file “mydocument.txt” from both directories “/home/user/documents/” and “/home/user/downloads/” by using either the original file or the symbolic link. For example, you can open the file “mydocument.txt” by typing either of the following commands in the terminal:
nano /home/user/documents/mydocument.txt
nano /home/user/downloads/mydocument_link
Both commands will open the same file, because the symbolic link points to the original file.
How to Remove symbolic link?
To remove a symbolic link in Linux, you can use the “rm” command followed by the name of the symbolic link.
Here is the syntax:-
rm [symbolic link name]
For example, to remove the symbolic link named “mylink”, use the following command:-
rm mylink
This will remove the symbolic link from the file system. Note that removing a symbolic link does not affect the target file or directory that it points to. If you want to remove the target file or directory as well, you will need to remove it separately.
FAQ
What is the main difference between a hard link and a symbolic (soft) link?
Hard links create a direct reference to the original file’s data on the disk, acting as if they are the file itself—changes to one affect all linked versions, and they don’t break if the original is moved (as long as it’s on the same file system).
Symbolic links (soft links), however, are like pointers that redirect to the target’s location; they can span file systems or drives but will break if the target is deleted or moved without updating the link. Hard links are limited to files (not directories in some systems), while symbolic links work for both files and directories.
How do symbolic links help with cloud storage syncing like Google Drive or Dropbox?
Symbolic links allow you to sync files or folders that aren’t natively in the cloud app’s designated sync directory. For instance, if an app requires files in a specific path but you want them stored elsewhere for organization, create a symbolic link in the sync folder pointing to the actual location.
This tricks the cloud service into syncing without duplicating data, saving space and avoiding conflicts—ideal for users managing large media libraries or development projects across devices.
Can I create a symbolic link across different drives in Windows, and how?
Yes, symbolic links in Windows support cross-drive linking, which is useful for redirecting app data from a full C: drive to a spacious D: drive. Use the mklink command with admin privileges: for a directory, run mklink /D "C:\LinkPath" "D:\TargetPath".
This creates a soft link that seamlessly redirects access. Note that hard links (/H or /J) are restricted to the same drive and file system, so stick to /D for cross-drive scenarios.
What happens to a symbolic link if the target file or folder is deleted?
If the target is deleted, a symbolic (soft) link becomes a “dangling” or broken link—it still exists but points to nothing, leading to errors when accessed (e.g., “file not found”).
Hard links, however, remain intact because they reference the data directly; the file only fully deletes when all hard links are removed. To avoid issues, regularly verify links with commands like ls -l in Linux or dir in Windows CMD to spot broken ones.
How can I identify if a file is a symbolic link in Linux or Windows?
In Linux, use ls -l—symbolic links show as l in the permissions (e.g., lrwxrwxrwx) with an arrow -> pointing to the target. For deeper checks, file filename will confirm it’s a symlink.
In Windows, open Command Prompt and run dir /A:L to list junction points and symlinks, or use PowerShell’s Get-ChildItem | Where-Object { $_.Attributes -band [IO.FileAttributes]::ReparsePoint } to filter them. This helps in troubleshooting without accidentally deleting originals.
Symbolic links work on external USB drives formatted with NTFS (Windows) or ext4 (Linux), but FAT32 or exFAT may not support them fully due to lacking reparse points.
For network shares, they function if the file system allows (e.g., SMB shares on Windows), but absolute paths are safer than relative ones to prevent breakage across machines. Always test access permissions, as symlinks inherit the target’s security settings.
How to create a symbolic link for a file in Linux without specifying a name?
If you omit the symbolic filename in the ln -s command (e.g., ln -s /path/to/target), Linux creates the link in the current directory using the target’s basename.
This is handy for quick setups but can lead to overwrites if a file with that name exists—add -f to force it. For directories, ensure you’re not creating loops, which could cause infinite recursion errors in file explorers.
What are the risks of using third-party tools for creating symbolic links in Windows?
Tools like Link Shell Extension simplify the process with a GUI but introduce risks such as compatibility issues with Windows updates, potential malware from unverified downloads, or unsigned executables triggering antivirus flags.
They may also lack fine-grained control over link types compared to mklink. Stick to official sources and run as admin; if concerned, enable Developer Mode in Windows Settings to use mklink without third-party apps.
How do I resolve “permission denied” errors when creating symbolic links?
This often stems from lacking admin rights—run Command Prompt as administrator in Windows or use sudo in Linux (e.g., sudo ln -s target link).
On Windows post-Creator’s Update, enable Developer Mode via Settings > Update & Security > For developers. Also, check file system permissions with icacls (Windows) or ls -l (Linux), ensuring the user has write access to the link’s directory. For network paths, verify share permissions.
Can symbolic links cause performance issues in applications?
Generally, no—redirection is near-instantaneous with negligible overhead. However, excessive nested links or dangling ones can slow down file operations, especially in large directories scanned by antivirus or backup software.
On older hardware or fragmented drives, hard links might perform slightly better since they avoid redirection. Monitor with tools like strace in Linux to trace syscall overhead if you suspect issues.
Why are symbolic links more common than hard links in Unix/Linux systems?
Symbolic links are preferred because they can point to files or directories across different file systems, unlike hard links which are confined to the same partition.
They also allow linking to directories and handle deletions more flexibly (though creating dangling links), making them versatile for tasks like software installations or path aliasing in complex setups, while hard links are better for data integrity in single-file-system scenarios.
What are the differences between symbolic links and Windows shortcuts?
Windows shortcuts (.lnk files) are high-level aliases managed by the shell, primarily for user interfaces like desktops, and contain metadata like icons or working directories.
Symbolic links, however, are file-system level (via NTFS reparse points), transparent to applications, and behave like the target itself without extra metadata. Shortcuts don’t work in command-line tools or across OSes as seamlessly, while symlinks do but require admin privileges to create.
What are the key implementation differences for symbolic links in Windows versus Linux?
In Linux, symlinks are created with ln -s and stored as special files in the inode, supporting relative/absolute paths natively. Windows uses mklink (requiring admin or Developer Mode), relying on NTFS reparse points, with distinctions like junctions for directories (hard-link equivalents) and no native support pre-Vista.
Linux treats symlinks more uniformly across file systems, while Windows has stricter privilege requirements and better integration with network paths.
How much disk space does a symbolic link actually consume?
Symbolic links are lightweight, typically using just a few bytes (around 100-200) to store the path to the target, regardless of the target’s size—they don’t duplicate data.
This makes them efficient for organization without wasting space, unlike copying files. Hard links don’t add extra space either, as they share the same inode/data blocks.
How can I read or modify the target path of a symbolic link without accessing the linked file?
In Linux, use readlink linkname to view the target path, or realpath for the resolved absolute path. To change it, delete and recreate the link, as direct editing isn’t supported—tools like symlinks can help scan and convert.
In Windows, dir /A:L shows targets, but modification requires recreating via mklink; PowerShell’s Get-Item with -Force can inspect properties for scripting.
What happens when you add a symbolic link to a version control system like Git or SVN?
Git treats symlinks as special files, storing the target path and preserving them across clones (on supported OSes). SVN also supports them but may require configuration for Windows compatibility, as older versions treated them as text files.
Adding one commits the link itself, not the target—deleting the target creates a dangling link in the repo, which can break builds; always commit targets separately if needed.
How do symbolic links behave in Windows Subsystem for Linux (WSL)?
In WSL, Linux symlinks created via ln -s work within the Linux environment but may not display or function properly in Windows File Explorer if pointing to Windows paths—use absolute paths or convert with tools like wslpath.
Windows symlinks are accessible from WSL, enabling cross-OS workflows, but avoid loops and test permissions, as WSL inherits Windows ACLs for interoperability.
Can symbolic links be chained (point to other symlinks), and what are the implications?
Yes, symlinks can chain, where one points to another, creating a redirect chain—Linux and Windows resolve them recursively up to a limit (e.g., 40 in Linux to prevent infinite loops).
This is useful for modular setups but risks performance hits from deep chains or breakage if an intermediate link fails. Use readlink -f in Linux or Resolve-Path in PowerShell to trace the full chain.
What security risks are associated with using symbolic links?
Symlinks can enable attacks like “symlink race conditions,” where an attacker creates a link to redirect operations to sensitive files (e.g., /etc/passwd). In shared environments, dangling links might be exploited.
Mitigate by using absolute paths, restricting privileges (e.g., nofollow flags in apps), and scanning with tools like find -type l -xtype l for broken ones. Windows adds UAC prompts for creation to reduce risks.
How do I copy or move symbolic links without breaking them or copying the target data?
To copy symlinks as-is (without dereferencing), use cp -P in Linux or robocopy /SL in Windows—these preserve the link structure. For moving, mv in Linux handles them directly; in Windows, use move or PowerShell’s Move-Item -Path link -Force.
Avoid cp -R without flags, as it might follow and duplicate targets—test with --preserve=links in rsync for backups.
What is the difference between NTFS directory junctions and symbolic links in Windows?
Directory junctions are a type of reparse point that act like hard links for directories, limited to the same volume and unable to span drives or target files.
Symbolic links are more flexible, supporting files, directories, cross-drive, and remote paths, but require higher privileges. Use junctions (mklink /J) for local directory aliasing to avoid potential loops, while symlinks (mklink /D) offer broader use cases.
How can I list all symbolic links on a Windows or Linux system?
In Linux, use find / -type l to search the entire system for symlinks (add -xtype l for broken ones), though it may take time on large drives—limit with paths like find /home.
In Windows, Command Prompt’s dir /A:L /S C:\ recursively lists reparse points (symlinks and junctions); for PowerShell, Get-ChildItem C:\ -Recurse -Attributes ReparsePoint. This is useful for auditing and cleanup.
What are common mistakes when using relative vs. absolute paths in symbolic links?
Relative paths (e.g., ln -s ../target link) are portable but break if the link is moved, as they’re resolved from the link’s location—common in scripts or moved directories.
Absolute paths (e.g., /full/path/to/target) are stable but less flexible across systems. Always verify with readlink or test access; use relative for local structures and absolute for system-wide to avoid “no such file” errors.
How do I find and fix broken (dangling) symbolic links in a directory?
In Linux, scan with find . -type l -xtype l to list dangling links, then fix by updating targets (rm link; ln -s new_target link) or removing them. Tools like symlinks -r . -d can delete broken ones automatically.
In Windows, use dir /A:L /S | find "SYMLINK" and manually check; PowerShell scripts can automate resolution. Prevent by using version control or monitoring tools.
Can symbolic links point to network locations, and what issues might arise?
Yes, in Windows (mklink /D \\server\share link) and Linux (ln -s /mnt/share link), but issues include network latency causing delays, broken links if offline, and permission mismatches across domains.
Relative paths won’t work for remote; use UNC paths in Windows. Test with test -e link in Linux or if exist link in batch to handle availability.
Symlinks are crucial for .so files, where versions like libfoo.so.1 point to libfoo.so.1.0 via symlinks for dynamic linking—ldconfig manages them.
Issues arise from “soname bumps” during updates, breaking apps if links aren’t updated; use ldd executable to check dependencies. Distributions handle this via packages, but manual installs require careful symlink management to avoid “library not found” errors.
Do Windows and Linux recognize each other’s symbolic links?
Linux symlinks on shared drives (e.g., NTFS via WSL) may not display correctly in Windows Explorer or vice versa, often appearing as broken or inaccessible due to file system differences.
Windows can read Linux ext4 symlinks in WSL, but native recognition is limited—use tools like wsl.exe for conversion. For dual-boot, format drives compatibly and test cross-access to avoid compatibility pitfalls.
How to dereference and replace symbolic links with actual files or directories?
To replace a symlink with its target, use cp -L symlink newfile in Linux to copy the dereferenced content, then remove the link. For directories, rsync -a --copy-links source/ dest/ preserves structure.
In Windows, robocopy /E /COPYALL /SL source dest with manual replacement. This is useful for flattening structures but risks data duplication—always backup first.
Can I make symbolic links in Linux behave more like Windows shortcuts, such as with custom icons?
Linux symlinks are plain file-system objects without built-in metadata like icons; use desktop entries (.desktop files) for shortcut-like behavior with icons via tools like xdg-desktop-icon.
For file managers like Nemo, extensions can add visual cues, but core symlinks remain text-based. This hybrid approach bridges the gap for GUI users without altering symlink functionality.
Conclusion
Symbolic links can help make our system storage spaces much more uncluttered. They also make syncing easier especially for folks who use Dropbox, Google Drive, and other applications like it.
Many apps and programs prefer their files stored somewhere specific and this sometimes causes users to have other empty memory options while a particular memory option is full.
Using these links above, you can just give the app or program the impression that the files and folders it needs are still in its preferred specific location when in reality, it’s just a hard link that’s there.
If you have any issues creating links whether in Linux or Windows, please use the comments section below to explain your problem and I’ll get back to you with fixes.
































