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
  • 相关阅读:
    软件开发规范
    Fail2ban + firewalld 防护doss攻击
    SourceTree&Git部分名词解释
    训子
    一个网络下,手机如何访问本地网址
    tempalte.js的一般用法
    template.js的介绍
    获取URL中的参数
    js判断苹果和安卓端或者wp端
    HTML5与WebGL编程
  • 原文地址:https://www.cnblogs.com/654321cc/p/9102054.html
Copyright © 2011-2022 走看看