ln -s target linkname creates a symlink; rm linkname removes just the link, leaving the target untouched. The two things that actually cause outages — a relative link breaking after a move, and ln -sf re-pointing a link into a directory instead of replacing it — are the ones worth a real demonstration.
Relative vs. absolute: it depends on what moves
The common claim is “relative links break when moved.” That’s only half true — it depends on whether the link moves with its target or away from it. Moving the whole containing directory (link and target travel together):
$ mv proj proj_renamed
$ cat proj_renamed/rel.txt # relative: still resolves
target content
$ cat proj_renamed/abs.txt # absolute: baked-in old path is gone
cat: proj_renamed/abs.txt: No such file or directory
Moving only the link, leaving the target where it was:
$ mv projB/rel.txt elsewhere/rel.txt
$ cat elsewhere/rel.txt # relative: was resolved against the old directory, now missing
cat: elsewhere/rel.txt: No such file or directory
$ cat elsewhere/abs.txt # absolute: target never moved, still resolves
target content B
A relative symlink is resolved against its own directory at access time, not the directory it was created in. So: relative links are safe when you’re moving or renaming a project as a unit (the common case — cloning a repo, renaming a release folder); absolute links are safer when the link itself gets relocated but the target is fixed infrastructure (like /etc/alternatives-style version pointers).
ln -sf on an existing directory symlink — the classic footgun
If current is already a symlink to a directory, running ln -sf new_target current does not replace current — ln sees that current resolves to a directory and creates the new link inside it instead:
$ readlink current
release-1.0
$ ln -sf release-2.0 current
$ find current -maxdepth 1
current
current/release-2.0
current now still points at release-1.0, plus there’s a stray (likely broken) link buried inside it. The fix is -n, which tells ln to treat an existing symlink target as the link to replace, not a directory to write into — per the BSD ln(1) man page, it is most useful with -f, to replace a symlink which may point to a directory:
$ ln -sfn release-2.0 current
$ readlink current
release-2.0
Always use ln -sfn, never bare ln -sf, when re-pointing a symlink that might already exist and might already be a directory — this is exactly the pattern used for “current release” deploy symlinks, where getting it wrong silently leaves the old version live.
Finding broken links, and rm’s trailing-slash trap
find -L . -type l lists only symlinks that find could not resolve — i.e., broken ones — because -L makes it dereference working links into their real type first; the BSD find(1) man page documents the fallback that makes this work — if the referenced file does not exist, the file information and type will be for the link itself:
$ find -L . -type l
./broken.txt
To remove a symlink that points at a directory, don’t add a trailing slash — on this Mac’s rm, a trailing slash makes it treat the link as the directory itself and refuse:
$ rm linktodir # no slash: removes the link, target untouched
$ rm linktodir2/ # trailing slash:
rm: linktodir2/: is a directory
Moving the whole directory, moving only the link, the ln -sf footgun with its -sfn fix and the find -L . -type l listing are all rebuilt in manage-symlinks.sh, whose rm check passes whether your rm refuses, as BSD’s does, or removes only the link, and fails only if the target directory’s contents are destroyed.
For locating files by owner alongside symlink audits, see the find command tutorial.