zoukankan      html  css  js  c++  java
  • Linux 命令ln

    在linux中可用ln命令创建一个文件的链接(软链接或者硬链接)

    硬链接的使用:

    root@IdeaPad:~# ln 2.txt e.txt
    
    root@IdeaPad:~# ls
    1.txt  2.txt  3.txt  4.txt  5.txt  5.txt~  e.txt  test
    
    root@IdeaPad:~# cat 2.txt
    在li上,安装软件一共有三种方式:
    1.源代码安装
    2.包安装
    3.apt在线安装
    root@IdeaPad:~# cat e.txt 
    在li上,安装软件一共有三种方式:
    1.源代码安装
    2.包安装
    3.apt在线安装
    root@IdeaPad:~# 
    

     软链接的使用:

    root@IdeaPad:~# ln -s 2.txt evilxr
    root@IdeaPad:~# ls -l
    total 32
    -rw-r--r-- 1 root root  101  5月 29 10:03 1.txt
    -rw-r--r-- 2 root root   96  5月 29 10:46 2.txt
    -rw-r--r-- 1 root root  115  5月 29 10:56 3.txt
    -rw-r--r-- 1 root root  181  5月 29 11:12 4.txt
    -rw-r--r-- 1 root root 2717  5月 29 12:00 5.txt
    -rw-r--r-- 1 root root   18  5月 29 11:51 5.txt~
    -rw-r--r-- 2 root root   96  5月 29 10:46 e.txt
    lrwxrwxrwx 1 root root    5  6月  2 13:01 evilxr -> 2.txt
    drwxr-xr-x 2 root root 4096  5月 29 10:17 test
    
    root@IdeaPad:~# cat evilxr
    在li上,安装软件一共有三种方式:
    1.源代码安装
    2.包安装
    3.apt在线安装
    root@IdeaPad:~# 
    
    若非特别声明,文章均为Evilxr的个人笔记,转载请注明出处。
  • 相关阅读:
    解题报告 The Rabbits
    解题报告 Function
    解题报告 大富翁
    解题报告 QUE
    解题报告 The cubes(即 银河英雄传说 NOI 2002)
    解题报告 xth 的苹果树
    解题报告 solve
    解题报告 Paid Roads
    解题报告 最小波动
    解题报告 Pizza
  • 原文地址:https://www.cnblogs.com/evilxr/p/3764253.html
Copyright © 2011-2022 走看看