How to create a symlink to a file in Unix and Linux

Home forums Unix and Linux How to create a symlink to a file in Unix and Linux

This topic contains 0 replies, has 1 voice, and was last updated by  Hemant Sharma 1 month, 2 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2217

    Hemant Sharma
    Moderator

    symlink in unix/linux are created using ln ( lInK ) command and follows the same syntax as cp and mv command

    ln -s

    file name has to be either local or with absolute path

    -s stand for soft symlink which can span file systems as it just points to existing file name. File contents are lost if original file is deleted.

    Without any option ln creates hard link , which is limited to current file system only and point to inode of existing file, file contents are available as long as there is one link exists.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.