Linux command (+): ln command

Source: Internet
Author: User

Command format:

ln [parameter] [source file or directory] [destination file or directory]

Necessary parameters:

-B Delete, overwrite previously established link

-D allows super users to make hard links to directories

-F Force Execution

-I interactive mode, file presence prompts the user whether to overwrite

-N treats symbolic links as generic directories

-S soft link (symbolic link)

-V displays detailed processing procedures

Example 1: Create a soft link to a file

Ln-s Log2013.log link2013

Description

Create soft link link2013 for Log2013.log file, link2013 will expire if Log2013.log is lost

Example 2: Create a hard link to a file

ln Log2013.log ln2013

Description

Create a hard link for log2013.log ln2013,log2013.log the same as the properties of ln2013

Example 4: Link a file to the same name in another directory

ln Log2013.log test3

Example 5: Creating a soft link to a directory

Ln-sv/opt/soft/test/test3/opt/soft/test/test5

Description

1. Directories can only create soft links

2. Directory creation link must use absolute path, relative path creation will not be successful, will prompt: The number of layers of the symbolic connection too many such errors

3. modifying files in the target directory of the link changes synchronously in the source file directory

Linux command (+): ln command

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.