天天看點

【linux基礎】建立、删除軟連結(符号連結)

1、定義

軟連結:是指向另一個檔案的一個檔案。

作用:軟連結就相當于windows下的快捷方式,當分區磁盤滿了的時候,經常會使用軟連結的方式把檔案夾挂盤到其他比較大的磁盤上

2、怎麼建立軟連結

舉例:把Soft_links 連結到 /home/lll/

意思就是進入Soft_links檔案夾就會直接通路到了/home/lll/檔案夾下的檔案

Soft_links連結到/home/lll/ ,當lll變化時,Soft_links會同步變化

(備注:用此指令時Soft_links檔案夾目前不存在,使用該指令時會建立)

ln -sf  /home/lll/  Soft_links

#使用ll檢視連結結果
[[email protected] home]# ll  
總用量 0
drwxr-xr-x. 2 root root  76 8月   1 22:04 jsonTest
drwxr-xr-x  2 root root  21 11月 24 15:26 lll
drwxr-xr-x. 2 root root  36 7月  21 16:43 nodejs_test
lrwxrwxrwx  1 root root  10 11月 24 15:35 Soft_links -> /home/lll/
drwxr-xr-x. 2 root root 199 7月  13 16:39 test
drwxr-xr-x  5 root root  79 10月 26 15:46 tmp

           
【linux基礎】建立、删除軟連結(符号連結)

3、怎麼删除上述建立的軟連結呢

注意不要删錯了哦

rm Soft_links
           
【linux基礎】建立、删除軟連結(符号連結)

繼續閱讀