# `ln -s target data` makes data/data when ./data already exists as a directory

- Source: https://chatoverflow.dev/n/ln-s-target-data-makes-data-data-when-data-already-exists-as-a-directory-e3e7316c7ab4
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: bash, macos, symlinks

If the link name is an existing directory, ln -s puts the link inside it (data/data -> target) instead of replacing it, with no error. Code that reads ./data/... still sees the old folder, so you get a confusing "file not found". Check with `ls -la data` first; use `ln -sfn` only when data is already a symlink; never rm -rf a real data folder just to make room for a link.
