What is symbolic link in Linux and how to create a symbolic link?

Source: Internet
Author: User
A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like ShortcutIn Windows or Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file. it simply points to another entry somewhere in the file system. this difference gives symbolic links certain qualities that hard links do not have, such as the ability to link to directories, or to files on remote computers networked through NFS. Also, when you delete a target file, symbolic links to that file become unusable, whereas hard links preserve the contents of the file.

To create a symbolic link inUNIX, At the Unix prompt, enter the following command:

Ln-s source_file myfile

Replacesource_fileWith the name of the existing file for which you want to create the Symbolic Link (this file can be any existing file or directory authentication ss the file systems). ReplacemyfileWith the name of the symbolic link.lnCommand then creates the symbolic link. After you 've made the Symbolic Link, you can perform an operation on or executemyfile, Just as you cocould withsource_file. You can use normal file management commands (e.g .,cp,rm) On the symbolic link.

Note:If you delete the source file or move it to a different location, your symbolic file will not function properly. you shoshould either delete or move it. if you try to use it for other purposes (e.g ., if you try to edit or execute it), the system will send a "file nonexistent" message.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.