Connecting Symlink on MacOS (and Linux)
Open Terminal
You’ll find it in Applications > Utilities > Terminal.
Navigate to the directory where you want the symlink
cd /path/to/desired/location
Use the
ln -s
command
Syntax:ln -s [TARGET] [LINK_NAME]
TARGET
= the actual file or folder you want to link to.LINK_NAME
= the name (and location) of the symlink.
Example:
ln -s /Users/you/Documents/Projects/myproject /Users/you/Desktop/myproject_link
Verify the link
ls -l
You should see the symlink with an arrow pointing to the target.
Test it
Opening the symlink should take you directly to the original file or folder.
Connecting Symlink on Windows
Windows has two main ways: Command Prompt (cmd) and PowerShell.
A. Using Command Prompt
Open Command Prompt as Administrator
Press
Win + S
, typecmd
, right-click, and choose Run as administrator.
Use the
mklink
command
Syntax:mklink [options] LINK TARGET
Options:
/D
→ Directory symlink/H
→ Hard link (files only)/J
→ Directory junction
Examples:
File symlink:
mklink C:\Users\You\Desktop\notes.txt C:\Users\You\Documents\notes.txt
Directory symlink:
mklink /D C:\Users\You\Desktop\ProjectLink C:\Users\You\Documents\Projects\MyProject
Confirm it worked
Navigate to the link in File Explorer—opening it should take you to the original.
B. Using PowerShell
Open PowerShell as Administrator.
Use
New-Item
Syntax:New-Item -ItemType SymbolicLink -Path "LINK" -Target "TARGET"
Example:
New-Item -ItemType SymbolicLink -Path "C:\Users\You\Desktop\ProjectLink" -Target "C:\Users\You\Documents\Projects\MyProject"
✅ Tips & Notes
On macOS/Linux,
ln -s
is the go-to.On Windows,
mklink
requires Administrator by default, but Windows 10+ with Developer Mode lets you create symlinks without admin rights.Hard links point directly to file contents (not folders), while symlinks are more flexible.
Junctions are a Windows-only type of directory link, often used for backwards compatibility.
Symlink Setup Comparison: macOS vs Window
⚡ Quick Takeaways
On macOS/Linux,
ln -s
is the universal command.On Windows, use
mklink
in cmd orNew-Item
in PowerShell.Windows offers junctions in addition to symlinks and hard links.
Enable Developer Mode (Windows 10/11) to create symlinks without admin rights.
Feature | macOS / Linux | Windows (Command Prompt) | Windows (PowerShell) |
Command |
|
|
|
File symlink |
|
|
|
Directory symlink |
|
|
|
Hard link (file only) |
|
|
|
Junction (dir only) | N/A |
|
|
Permissions | Normal user rights | Requires Administrator (unless Developer Mode enabled) | Requires Administrator (unless Developer Mode enabled) |
Verification |
|
| `Get-Item link |