What does ln do?

make links between files.

▸ Explain your own ln command →

ln examples, explained

$ ln -s /usr/bin/python3 python

  • lnmake links between files
  • -smake a symbolic (soft) link instead of a hard link
  • /usr/bin/python3an argument passed to the command
  • pythonan argument passed to the command

$ ln -sf target link

  • lnmake links between files
  • -smake a symbolic (soft) link instead of a hard link
  • -fforce — remove an existing destination first
  • targetan argument passed to the command
  • linkan argument passed to the command

ln flags & options

-smake a symbolic (soft) link instead of a hard link
-fforce — remove an existing destination first
-ntreat a symlinked destination as a normal file
-vverbose — print the name of each linked file
-rmake the symlink target relative to the link location

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.