Soft and Hard Links

Soft links

  • Pointers to programs, files, or directories located elsewhere.
  • If the original program, file, or directory is renamed, moved, or deleted, the soft link is broken.
  • If you type ls -F you can see which files are soft links because they end with @
  • To create a soft link called filelink.txt that points to a file called file.txt, use this: ln -s file.txt filelink.txt

Hard links

  • Pointers to programs and files, but NOT directories
  • If the original program or file is renamed, moved, or deleted, the hard link is NOT broken
  • Hard links cannot span disk drives, so you CANNOT have a hard link on /dev/hdb that refers to a program or file on /dev/hda
  • To create a hard link called hardlink.txt that points to a file called file.txt, use this: ln file.txt hardlink.txt

0 Responses to “Soft and Hard Links”


  • No Comments

Leave a Reply