欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

cenos7创建删除软连接ln -s

程序员文章站 2024-02-26 13:57:04
...

创建软链接

ln -s [源文件或目录] [目标文件或目录]

rm –rf 软链接名称(请注意不要在后面加”/”
例:

[[email protected] aaa]# ll
total 12
drwxr-xr-x 2 root root 4096 Aug 19 10:06 bb
drwxr-xr-x 2 root root 4096 Aug 19 10:00 cc
drwxr-xr-x 2 root root 4096 Aug 19 09:49 dd
lrwxrwxrwx 1 root root   13 Aug 19 10:07 ee -> /home/aaa/bb/
[[email protected] aaa]# rm -rf ee
[[email protected] aaa]# ll
total 12
drwxr-xr-x 2 root root 4096 Aug 19 10:06 bb
drwxr-xr-x 2 root root 4096 Aug 19 10:00 cc
drwxr-xr-x 2 root root 4096 Aug 19 09:49 dd
[[email protected] aaa]# ln -s /home/aaa/bb/ ./ee
[[email protected] aaa]# ll
total 12
drwxr-xr-x 2 root root 4096 Aug 19 10:06 bb
drwxr-xr-x 2 root root 4096 Aug 19 10:00 cc
drwxr-xr-x 2 root root 4096 Aug 19 09:49 dd
lrwxrwxrwx 1 root root   13 Aug 19 10:23 ee -> /home/aaa/bb/