首页 > 系统服务 > 详细

Linux 命令ln

时间:2014-06-02 15:35:09      阅读:439      评论:0      收藏:0      [点我收藏+]

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

硬链接的使用:

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

 软链接的使用:

1
2
3
4
5
6
7
8
9
10
11
12
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

 

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

 

 

Linux 命令ln,布布扣,bubuko.com

Linux 命令ln

原文:http://www.cnblogs.com/evilxr/p/3764253.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!