Linux File System Command ln

Source: Internet
Author: User

Command: LN

Features: Linux under the file link function, the difference, soft link requires-s option, hard link does not need. The same is, all synchronous changes, but soft links do not need to occupy space, hard links occupy space

Usage: Soft Link: ln-s source file Destination file

Hard Link: ln source file Destination file

eg

[Email protected]6380-mt:~/test1$LNRen.. /test2/ren #硬链接 [email protected]-hp-compaq-pro-6380-mt:~/test1$ [email protected]-hp-compaq-pro-6380-mt:~/test1$ls.. /test2/Ren[email protected]-hp-compaq-pro-6380-mt:~/test1$ls-L: /test2/ Total4-rw-rw-r--2RENJG RENJG theSeptember1  -: Aren #文件占用磁盘大小 [email protected]-hp-compaq-pro-6380-mt:~/test1$ls-Ltotal8-rw-rw-r--1RENJG RENJG theSeptember1  -: AJin-rw-rw-r--2RENJG RENJG theSeptember1  -: ARen[email protected]-hp-compaq-pro-6380-mt:~/test1$LN-S Jin. /test2/Jin #软链接 [email protected]-hp-compaq-pro-6380-mt:~/test1$ [email protected]-hp-compaq-pro-6380-mt:~/test1$ls-L: /test2/ Total4lrwxrwxrwx1RENJG RENJG3September1  -: +Jin--Jin #并不占用磁盘大小-rw-rw-r--2RENJG RENJG theSeptember1  -: ARen[email protected]-hp-compaq-pro-6380-mt:~/test1$ls-Ltotal8-rw-rw-r--1RENJG RENJG theSeptember1  -: AJin-rw-rw-r--2RENJG RENJG theSeptember1  -: ARen[email protected]-hp-compaq-pro-6380-mt:~/test1$

Linux File System Command ln

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.