Compdigitec Labs

« | Home | »

Manipulating symbolic and hard links on Linux and Windows

By admin | August 23, 2008

Symbolic and hard links are a very convenient feature of the Linux and UNIX operating systems – they enable you to create a short alias, use it to avoid duplicate data and much, much more. They are also availible on Windows to a limited extent – NTFS supports only hard links while FAT/FAT32/VFAT supports neither. However, using Cygwin, you can use Windows shortcuts as symbolic links, but that is as far as it gets.

To create symbolic and hard links in Linux, make sure you have the GNU Coreutils installed, which provides the ln utility.

To create hard links and shortcuts in Microsoft Windows, download ln for Windows and place in a directory inside your %PATH%.

  1. ln -s TARGET LINKNAME – Creates a symbolic link (shortcut on Windows) called LINKNAME that points to TARGET. This works with both folders and files.
  2. ln TARGETFILE LINKNAME – Creates a hard link called LINKNAME that points to the file TARGETFILE. Only works for files; if you try to do it with a folder, the error message “ln: `/folder/name/here‘: hard link not allowed for directory“.
  3. ln -i COMMAND – Runs ln interactive mode, where it will ask you before running the command COMMAND, where the COMMAND is one of the commands above.
  4. ln -f COMMAND – Forces ln to override any existing files while running the command COMMAND. For example, if you do ln -s /bin file and currently file exists, you will get “ln: creating (symbolic/hard) link `linkname‘: File exists“. Use ln -f /bin file to make it work.
  5. (Windows only) You remove fake symbolic links (shortcuts) with del linkname.lnk to accommodate the fact that it is a Windows shortcut. You can remove hard links the normal way you delete a file – del hardlinkname.
  6. (Linux only) You remove symbolic and hard links the regular way you would remove files – rm yourlinkname.

If you found this article useful or helpful, please help Compdigitec spread the word or please leave a comment. Don’t forget to subscribe to Compdigitec Labs for more interesting articles!

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: Linux, Windows | 13 Comments »

13 Responses to “Manipulating symbolic and hard links on Linux and Windows”

  1. Stem Cell therapy Says:
    July 23rd, 2026 at 01:28

    … [Trackback]

    […] Find More here to that Topic: compdigitec.com/labs/2008/08/23/manipulating-symbolic-and-hard-links/ […]

  2. Creating AI Agents Says:
    July 23rd, 2026 at 01:46

    … [Trackback]

    […] Read More on on that Topic: compdigitec.com/labs/2008/08/23/manipulating-symbolic-and-hard-links/ […]

  3. PEP Says:
    July 27th, 2026 at 01:23

    … [Trackback]

    […] Find More on on that Topic: compdigitec.com/labs/2008/08/23/manipulating-symbolic-and-hard-links/ […]

  4. no refusal payday loans canada Says:
    August 2nd, 2026 at 14:14

    … [Trackback]

    […] There you can find 65186 more Information to that Topic: compdigitec.com/labs/2008/08/23/manipulating-symbolic-and-hard-links/ […]

  5. https://goldfishka1.avto-cash.ru Says:
    August 5th, 2026 at 12:44

    … [Trackback]

    […] Find More to that Topic: compdigitec.com/labs/2008/08/23/manipulating-symbolic-and-hard-links/ […]

  6. UV LED LAMP Says:
    August 12th, 2026 at 18:10

    … [Trackback]

    […] Here you can find 37666 more Information to that Topic: compdigitec.com/labs/2008/08/23/manipulating-symbolic-and-hard-links/ […]

  7. xüm tablets | plur beyond molly | buy xum plur | plur tablets | plur gummies | beyond molly | xum beyond shrooms | plur xum | xum community pack | xum wholesale | xum plur for sale | Says:
    September 6th, 2026 at 09:45

    … [Trackback]

    […] Info to that Topic: compdigitec.com/labs/2008/08/23/manipulating-symbolic-and-hard-links/ […]

  8. https://geels.ca/ Says:
    September 7th, 2026 at 10:53

    I am regular visitor, how are you everybody? This article posted at
    this web page is genuinely nice.

    my blog: https://geels.ca/

  9. bitstarz-review24.com Says:
    September 10th, 2026 at 16:01

    … [Trackback]

    […] Read More Information here on that Topic: compdigitec.com/labs/2008/08/23/manipulating-symbolic-and-hard-links/ […]

  10. payday loans Says:
    September 21st, 2026 at 21:22

    That’s a good point. I’d like to hear more!

    Also visit my site; payday loans

  11. Loans Canada short-term loans Says:
    September 21st, 2026 at 22:45

    I didn’t realize that, I’ll have to look into it further.

    My page; Loans Canada short-term loans

  12. e-transfer payday loans Says:
    September 21st, 2026 at 22:57

    Very insightful reflections on Manipulating symbolic and hard
    links on Linux and Windows at Compdigitec Labs! Thanks for sharing

    Here is my blog post … e-transfer payday loans

  13. Certified Translation Says:
    September 29th, 2026 at 05:52

    … [Trackback]

    […] Find More here to that Topic: compdigitec.com/labs/2008/08/23/manipulating-symbolic-and-hard-links/ […]

Comments