MainspringGuides › Create a symlink
macOS Guide

How to Create a Symlink on Mac With ln -s

Updated July 2026 · 3 min read

A symbolic link makes one folder or file appear at a second path, and everything on your Mac — Finder, Terminal, every app — treats the link as if it were the real thing. One command creates it. The syntax is easy; the part worth learning carefully is how to remove one without deleting what it points to.

The command: ln -s original link

Open Terminal (it’s in /Applications/Utilities, or search “Terminal” in Spotlight) and use this shape — target first, link second:

# ln -s /path/to/original /path/to/link
ln -s ~/Documents/Projects ~/Desktop/Projects
# undo: remove the link (the original is untouched)
rm ~/Desktop/Projects

That puts a “Projects” item on your Desktop that opens — and in every real sense is — the folder in Documents. Save a file into either path and it’s the same file. A few more useful patterns:

# link a single file instead of a folder
ln -s ~/Documents/config/settings.json ~/Desktop/settings.json
# link into a system location (needs admin rights)
sudo ln -s /opt/homebrew/bin/python3 /usr/local/bin/python3

Two gotchas. First, order: it’s always ln -s TARGET LINKNAME — real thing first. Second, use absolute or home-relative (~/) paths for the target. A symlink stores the path text you give it, so a link created with a relative target like ../Projects only resolves relative to wherever the link sits.

Verify it worked

List the folder containing the link with ls -l:

ls -l ~/Desktop
# lrwxr-xr-x  1 you  staff  28 Jul  2 10:04 Projects -> /Users/you/Documents/Projects

The leading l and the -> arrow confirm it’s a symlink and show exactly where it points. If the target path doesn’t exist (a typo, or you moved the original), the link is broken — Finder shows it with a question-mark badge when you try to open it, and cd into it fails. Symlinks don’t self-heal: fix one by deleting it and creating it again with the right target.

Remove a symlink safely

Delete the link, never the target:

# correct — removes only the pointer
rm ~/Desktop/Projects
# WRONG — never do this; the trailing slash follows the link,
# and -r deletes the real folder's contents
# rm -rf ~/Desktop/Projects/

The rules that keep you safe: plain rm on the link name, no -r, no trailing slash. Dragging the symlink to the Trash in Finder is equally safe — Finder trashes the pointer, not the folder it points to.

What symlinks are actually for

If you live entirely in Finder and just want a shortcut that survives the original being moved around, a Finder alias is the friendlier tool — see alias vs symlink for the trade-offs.

Check where a link points, months later

When you’ve forgotten what a link targets, readlink answers directly:

# print the stored target of a symlink
readlink ~/Desktop/Projects
# resolve through chained links to the final real path
readlink -f ~/Desktop/Projects

Finder is less forthcoming — a symlink’s Get Info window shows Kind as “Alias”, which is misleading but harmless. If you manage more than a couple of links, keep them in one place (a ~/Links folder works well) so a future you can audit them with a single ls -l instead of hunting across the disk.

Like the Terminal? You’ll like this more

Mainspring packages the macOS tweaks people usually collect as scattered Terminal commands — 90+ hidden settings as labelled, reversible toggles, with every change undoable in one click.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once