zoukankan      html  css  js  c++  java
  • Linux硬链接和软链接(符号链接)

    硬链接与软连接 :https://blog.csdn.net/u013777351/article/details/50557260

    索引节点:https://blog.csdn.net/jesseyoung/article/details/42524813

    硬链接:

    [root@VM_0_11_centos zuo]# vi 1.txt
    [root@VM_0_11_centos zuo]# ls
    1.txt  Scrapy
    [root@VM_0_11_centos zuo]# cp -l 1.txt 11.txt
    [root@VM_0_11_centos zuo]# ls -li
    total 12
    131601 -rw-r--r-- 2 root root   13 May 28 23:03 11.txt
    131601 -rw-r--r-- 2 root root   13 May 28 23:03 1.txt
    131487 drwxr-xr-x 5 root root 4096 May 28 18:20 Scrapy
    [root@VM_0_11_centos zuo]# vim 11.txt 
    [root@VM_0_11_centos zuo]# more 1.txt 
    hello,world!
    welcome back!
    [root@VM_0_11_centos zuo]# ln 1.txt 111.txt
    [root@VM_0_11_centos zuo]# ls -li 
    total 16
    131601 -rw-r--r-- 3 root root   27 May 28 23:06 111.txt
    131601 -rw-r--r-- 3 root root   27 May 28 23:06 11.txt
    131601 -rw-r--r-- 3 root root   27 May 28 23:06 1.txt
    131487 drwxr-xr-x 5 root root 4096 May 28 18:20 Scrapy

    软连接:

    [root@VM_0_11_centos zuo]# vi 1.txt
    [root@VM_0_11_centos zuo]# cp -s 1.txt 11.txt
    [root@VM_0_11_centos zuo]# ln -s 1.txt 111.txt
    [root@VM_0_11_centos zuo]# ls -li
    total 8
    131603 lrwxrwxrwx 1 root root    5 May 28 23:09 111.txt -> 1.txt
    131089 lrwxrwxrwx 1 root root    5 May 28 23:09 11.txt -> 1.txt
    131601 -rw-r--r-- 1 root root   13 May 28 23:08 1.txt
    131487 drwxr-xr-x 5 root root 4096 May 28 18:20 Scrapy
    [root@VM_0_11_centos zuo]# rm -f 11.txt 
    [root@VM_0_11_centos zuo]# ls -li
    total 8
    131603 lrwxrwxrwx 1 root root    5 May 28 23:09 111.txt -> 1.txt
    131601 -rw-r--r-- 1 root root   13 May 28 23:08 1.txt
    131487 drwxr-xr-x 5 root root 4096 May 28 18:20 Scrapy
    [root@VM_0_11_centos zuo]# rm -f 1.txt 
    [root@VM_0_11_centos zuo]# ls -li
    total 4
    131603 lrwxrwxrwx 1 root root    5 May 28 23:09 111.txt -> 1.txt # 1.txt 红色字体,闪动
    131487 drwxr-xr-x 5 root root 4096 May 28 18:20 Scrapy
  • 相关阅读:
    P4549 【模板】裴蜀定理
    POJ1606 Jugs
    2. 数据库连接池规范
    14. BootStrap * 组件
    BootStarpt
    13. Flex 弹性布局2 BootStrap
    12. Flex 弹性布局 BootStrap
    CSS3
    21. Servlet3.0 / 3.1 文件上传 Plus
    20. Servlet3.0 新特性
  • 原文地址:https://www.cnblogs.com/654321cc/p/9102054.html
Copyright © 2011-2022 走看看