How to Make a Symbolic Link on Windows, macOS, and Linux

A symbolic link — often called a symlink — is one of those filesystem features that quietly powers a lot of how operating systems work under the hood. Once you understand what they are and how to create them, you'll find yourself reaching for them more often than you'd expect.

What Is a Symbolic Link?

A symbolic link is a special type of file that acts as a pointer to another file or folder somewhere else on your system. When you open a symlink, your operating system transparently redirects you to the target — the actual file or directory it points to.

Think of it like a shortcut on your desktop, but far more powerful. A symlink works at the filesystem level, which means applications, scripts, and the OS itself treat it as if it were the real file or folder.

Two types of links exist on most systems:

  • Symbolic links (symlinks): Point to a path. If the target moves or is deleted, the link breaks.
  • Hard links: Point directly to the underlying data on disk. More rigid, but more resilient to target renaming.

For most everyday use cases, symbolic links are what you want.

Common Reasons to Create a Symbolic Link

  • Sync folders across locations — point a config folder to a cloud-synced directory without moving the original
  • Avoid duplicate files — share one large folder between two applications without copying data
  • Manage dotfiles — developers commonly symlink configuration files from a central repo to their expected system paths
  • Redirect app data — move a program's data folder to another drive while keeping the original path intact

How to Create a Symbolic Link on Linux and macOS 🔗

Both Linux and macOS use the same Unix-based ln command. The syntax is:

ln -s /path/to/target /path/to/symlink 
  • The -s flag specifies a symbolic link (without it, you'd create a hard link)
  • /path/to/target is the file or folder you want to point to
  • /path/to/symlink is where the new link will live

Example — linking a folder:

ln -s /Users/yourname/Dropbox/Projects /Users/yourname/Documents/Projects 

This creates a Projects link inside Documents that transparently opens your Dropbox folder.

To verify the link was created correctly:

ls -la /Users/yourname/Documents/ 

You'll see an arrow (->) showing where the symlink points.

To remove a symlink without deleting the target:

unlink /path/to/symlink 

Or use rm — it removes the link, not the original data.

How to Create a Symbolic Link on Windows

Windows has supported symlinks since Vista, but the process differs depending on your setup and permissions.

Method 1: Command Prompt (mklink)

Open Command Prompt as Administrator, then use:

mklink Link Target 

For a directory symlink, add the /D flag:

mklink /D C:UsersYourNameDocumentsProjects C:UsersYourNameDropboxProjects 
FlagCreates
(none)Symbolic link to a file
/DSymbolic link to a directory
/HHard link to a file
/JDirectory junction (older Windows-compatible)

Directory junctions (/J) behave similarly to directory symlinks but have different behavior with relative paths and network locations. For most local use cases, /D symlinks and junctions are interchangeable.

Method 2: Enable Developer Mode (No Admin Required)

On Windows 10 and 11, enabling Developer Mode in Settings allows standard users to create symlinks without elevated privileges. This is useful on systems where you don't have admin access for every operation.

Path: Settings → Privacy & Security → For Developers → Developer Mode

Once enabled, mklink works without requiring an Administrator prompt.

Method 3: PowerShell

New-Item -ItemType SymbolicLink -Path "C:LinkPath" -Target "C:TargetPath" 

PowerShell's New-Item cmdlet is scriptable and fits naturally into automation workflows.

Key Variables That Affect How Symlinks Behave 🖥️

Permissions and privileges are the most common stumbling block. On Windows especially, creating symlinks requires either admin rights or Developer Mode — something that catches many users off guard.

Relative vs. absolute paths matter more than most people realize. A symlink created with an absolute path (/home/user/folder) will always point to that exact location. One created with a relative path depends on where the link itself lives — move the link, and it may break.

Cross-filesystem and cross-drive links work differently across operating systems. On Linux and macOS, symlinks work across mounted drives and partitions without issue. On Windows, there are limitations — particularly with network paths and some cross-drive scenarios — where junctions may behave differently from true symlinks.

Application compatibility is worth considering. Most modern applications follow symlinks transparently. Some older software, sandboxed apps, or backup tools may not traverse them as expected, or may back up the link rather than the data.

What Can Go Wrong

  • Broken symlinks occur when the target is moved, renamed, or deleted. The link remains but points nowhere — sometimes called a "dangling" symlink.
  • Circular symlinks happen when links point back to themselves, which can cause infinite loops in certain tools or scripts.
  • Permission mismatches — a symlink may be accessible even when the underlying target requires elevated permissions, or vice versa, depending on how the OS resolves link traversal.

Checking symlink health periodically matters in environments where files move around frequently.

The Part That Depends on Your Setup

Whether you're working on a home NAS, a developer workstation, a managed corporate machine, or a single-user laptop changes almost everything about which method makes sense. Admin access, OS version, whether you're linking files or directories, and what applications will consume those links all shape which approach actually works — and which ones create subtle problems you won't notice until later. ⚙️