Linuxln command (link command) details

Source: Internet
Author: User
The linuxln command (link command) details that ln is another important command in linux. its function is to create a non-same link for a file in another location, the most common parameter of this command is-s. its usage is ln & amp; ndash; s. the target file of the source file. When... linux ln command (link command) details ln is another important command in linux. its function is to create a non-same link for a file in another location, the most common parameter of this command is-s. The specific usage is the target file of the ln-s source file. When we need to use the same file in different directories, we do not need to put a file that must be the same under each required Directory. we only need to put it in a fixed directory, put the file, and then use the ln command link in other directories to link it, without occupying disk space repeatedly. For example, ln-s/bin/less/usr/local/bin/less www.2cto.com-s indicates the symbol (symbolic. There are two points to note: first, the ln command will keep the synchronization of each link file, that is, no matter which one you change, other files will change the same; second, there are two types of ln links: soft link and hard link. the soft link is ln-s *****. it will only generate a file image at your selected location, it does not occupy disk space. the hard link ln *** has no parameter-s. it will generate a file of the same size as the source file at the selected position, both soft links and hard links are synchronized. If you use ls to view a directory, you will find that some files are followed by a @ symbol, that is, a file generated using ln command, and you can use ls-l command to view it, the link path is displayed. Instructions: www.2cto.com command name: ln usage permission: all users use ln [options] source dist, where the option format is: [-bdfinsvF] [-S backup-suffix] [-V {numbered, existing, simple}] [-- help] [-- version] [--] description: in a Linux/Unix file system, there is a so-called link. we can regard it as an alias of the file, and there are two types of links: hard link) symbolic link indicates that a file can have multiple names, while a soft link generates a special file, the content of this file points to another file. Hard links exist in the same file system, but soft links can span different file systems. Ln source dist is used to generate a connection (dist) to the source. As for hard link or soft link, it is determined by the parameter. No matter whether it is a hard link or soft link, it will not copy the original file, it will only occupy a very small amount of disk space. Www.2cto.com-f: when linking, delete the file with the same name as dist-d: allow system managers to hard link their directories-I: when deleting an archive with the same name as dist, first ask-n: During soft link, dist will be treated as a general Archive-s: perform soft link (symbolic link)-v: display file name B before Link: back up the file that will be overwritten or deleted at link end-S SUFFIX: add the backup file to the end of SUFFIX-v method: specifies the backup METHOD -- help: displays the auxiliary instructions -- version: displays the version example: generates a symbolic link for the file yy: zz ln-s yy zz generates a hard link: zz ln yy xx
 
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.