1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      linux軟鏈接如何創(chuàng)建

      這篇“l(fā)inux軟鏈接如何創(chuàng)建”文章的知識點(diǎn)大部分人都不太理解,所以小編給大家總結(jié)了以下內(nèi)容,內(nèi)容詳細(xì),步驟清晰,具有一定的借鑒價(jià)值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“l(fā)inux軟鏈接如何創(chuàng)建”文章吧。

      創(chuàng)新互聯(lián)服務(wù)項(xiàng)目包括息烽網(wǎng)站建設(shè)、息烽網(wǎng)站制作、息烽網(wǎng)頁制作以及息烽網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,息烽網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到息烽省份的部分城市,未來相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!

      在linux中,軟連接相當(dāng)于windows中的快捷方式,以路徑的形式存在;在軟連接中,文件實(shí)際上是一個(gè)文本文件,其中包含的有另一文件的位置信息。創(chuàng)建軟連接的語法為“l(fā)n -s target source”,參數(shù)“target”表示目標(biāo)文件(夾),即被指向的文件(夾),而參數(shù)“source”表示當(dāng)前目錄的軟連接名,即源文件(夾)。

      本教程操作環(huán)境:linux7.3系統(tǒng)、Dell G3電腦。

      Linux鏈接分兩種,一種被稱為硬鏈接(Hard Link),另一種被稱為符號鏈接(Symbolic Link),又稱軟鏈接。

      Linux軟連接

      相當(dāng)于windows中的快捷方式,由于軟連接所創(chuàng)建的文件為一個(gè)獨(dú)立的新的文件,所以會(huì)占用掉indoe與block

      它實(shí)際上是一個(gè)特殊的文件。在軟連接中,文件實(shí)際上是一個(gè)文本文件,其中包含的有另一文件的位置信息。

      • 軟鏈接,以路徑的形式存在。類似于Windows操作系統(tǒng)中的快捷方式

      • 軟鏈接可以 跨文件系統(tǒng) ,硬鏈接不可以

      • 軟鏈接可以對一個(gè)不存在的文件名進(jìn)行鏈接

      • 軟鏈接可以對目錄進(jìn)行鏈接

      1、創(chuàng)建語法

      ln -s target source

      解釋下:

      ln -s:表示創(chuàng)建一個(gè)軟連接;

      target:表示目標(biāo)文件(夾)【即被指向的文件(夾)】

      source:表示當(dāng)前目錄的軟連接名。【源文件(夾)】

      2 具體示例

      • step 1.創(chuàng)建測試文件及文件夾

      [root@server6 ~]# mkdir test_chk
      [root@server6 ~]# touch test_chk/test.txt 
      [root@server6 ~]# echo "hello spark" > test_chk/test.txt 
      [root@server6 ~]# cat test_chk/test.txt 
      hello spark
      [root@server6 ~]# ll
      總用量 84
      -rw-------.  1 root root  1257 6月  16 01:17 anaconda-ks.cfg
      drwxr-xr-x. 25 root root  4096 11月  1 10:28 azkabanJob
      -rw-r--r--.  1 root root 67322 11月  4 10:24 azkabanJob.zip
      drwxr-xr-x.  4 root root    37 7月  13 11:01 hadoop_temp
      -rw-r--r--.  1 root root    54 7月   4 14:11 HelloLinux.txt
      drwxr-xr-x.  2 root root    22 11月  4 10:41 test_chk
      -rw-r--r--.  1 root root    67 10月  8 15:52 zookeeper.out
      [root@server6 ~]# ln -s test_chk/ test_chk_ln
      [root@server6 ~]# ll
      總用量 84
      -rw-------.  1 root root  1257 6月  16 01:17 anaconda-ks.cfg
      drwxr-xr-x. 25 root root  4096 11月  1 10:28 azkabanJob
      -rw-r--r--.  1 root root 67322 11月  4 10:24 azkabanJob.zip
      drwxr-xr-x.  4 root root    37 7月  13 11:01 hadoop_temp
      -rw-r--r--.  1 root root    54 7月   4 14:11 HelloLinux.txt
      drwxr-xr-x.  2 root root    22 11月  4 10:41 test_chk
      lrwxrwxrwx.  1 root root     9 11月  4 10:42 test_chk_ln -> test_chk/
      -rw-r--r--.  1 root root    67 10月  8 15:52 zookeeper.out
      [root@server6 ~]# cd test_chk_ln/
      [root@server6 test_chk_ln]# ll
      總用量 4
      -rw-r--r--. 1 root root 12 11月  4 10:41 test.txt
      [root@server6 test_chk_ln]# cat test.txt 
      hello spark
      [root@server6 test_chk_ln]# ll
      總用量 4
      -rw-r--r--. 1 root root 12 11月  4 10:41 test.txt
      [root@server6 test_chk_ln]# cat test.txt 
      hello spark

      注意

      1、創(chuàng)建軟連接時(shí),不用創(chuàng)建文件夾。

      2、命令示例解釋

      執(zhí)行的命令是: ln -s /storage/lawson/scores scor

      其含義就是:將scor指向 /storage/lawson/scores/目錄下

      linux軟鏈接如何創(chuàng)建

      這里是當(dāng)前的scor 指向 /storage/lawson/scores 中。這里顯示紅色,是因?yàn)?code>/storage/lawson/scores這個(gè)目錄不存在,如果創(chuàng)建該目錄,那就可以得到藍(lán)色的顯示了。

      linux軟鏈接如何創(chuàng)建
      需要注意的是,當(dāng)前所有目錄下的文件都不能重名,因?yàn)槲抑坝幸粋€(gè)文件夾是scores,所以這里就簡單的命名成了scor

      軟連接的刪除

      rm -rf ./test_chk_ln/ 會(huì)刪除文件夾下的所有內(nèi)容,但是沒有刪除這個(gè)鏈接;
      rm -rf ./test_chk_ln 則是僅刪除這個(gè)軟鏈接,不會(huì)刪除下面的內(nèi)容。

      • 錯(cuò)誤示范

      [root@server6 test_chk_ln]# cd ..
      [root@server6 ~]# ll
      總用量 84
      -rw-------.  1 root root  1257 6月  16 01:17 anaconda-ks.cfg
      drwxr-xr-x. 25 root root  4096 11月  1 10:28 azkabanJob
      -rw-r--r--.  1 root root 67322 11月  4 10:24 azkabanJob.zip
      drwxr-xr-x.  4 root root    37 7月  13 11:01 hadoop_temp
      -rw-r--r--.  1 root root    54 7月   4 14:11 HelloLinux.txt
      drwxr-xr-x.  2 root root    22 11月  4 10:41 test_chk
      lrwxrwxrwx.  1 root root     9 11月  4 10:42 test_chk_ln -> test_chk/
      -rw-r--r--.  1 root root    67 10月  8 15:52 zookeeper.out
      [root@server6 ~]# rm -rf ./test_chk_ln/
      [root@server6 ~]# ll
      總用量 84
      -rw-------.  1 root root  1257 6月  16 01:17 anaconda-ks.cfg
      drwxr-xr-x. 25 root root  4096 11月  1 10:28 azkabanJob
      -rw-r--r--.  1 root root 67322 11月  4 10:24 azkabanJob.zip
      drwxr-xr-x.  4 root root    37 7月  13 11:01 hadoop_temp
      -rw-r--r--.  1 root root    54 7月   4 14:11 HelloLinux.txt
      drwxr-xr-x.  2 root root     6 11月  4 10:42 test_chk
      lrwxrwxrwx.  1 root root     9 11月  4 10:42 test_chk_ln -> test_chk/
      -rw-r--r--.  1 root root    67 10月  8 15:52 zookeeper.out
      [root@server6 ~]# cd test_chk
      [root@server6 test_chk]# ll
      總用量 0
      [root@server6 test_chk]# ll
      總用量 0

      可以發(fā)現(xiàn)該文件夾下的內(nèi)容都被刪了。。。

      • 正確刪除軟連接

      [root@server6 ~]# rm -rf ./test_chk_ln
      [root@server6 ~]# ll
      總用量 84
      -rw-------.  1 root root  1257 6月  16 01:17 anaconda-ks.cfg
      drwxr-xr-x. 25 root root  4096 11月  1 10:28 azkabanJob
      -rw-r--r--.  1 root root 67322 11月  4 10:24 azkabanJob.zip
      drwxr-xr-x.  4 root root    37 7月  13 11:01 hadoop_temp
      -rw-r--r--.  1 root root    54 7月   4 14:11 HelloLinux.txt
      drwxr-xr-x.  2 root root    22 11月  4 10:44 test_chk
      -rw-r--r--.  1 root root    67 10月  8 15:52 zookeeper.out
      [root@server6 ~]# cd test_chk/
      [root@server6 test_chk]# ll
      總用量 4
      -rw-r--r--. 1 root root 12 11月  4 10:44 test.txt

      以上就是關(guān)于“l(fā)inux軟鏈接如何創(chuàng)建”這篇文章的內(nèi)容,相信大家都有了一定的了解,希望小編分享的內(nèi)容對大家有幫助,若想了解更多相關(guān)的知識內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。


      網(wǎng)站題目:linux軟鏈接如何創(chuàng)建
      當(dāng)前網(wǎng)址:http://www.ef60e0e.cn/article/gdgggg.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        桂林市| 屏边| 芜湖县| 新蔡县| 临颍县| 龙岩市| 通州市| 新田县| 雅安市| 黄梅县| 翁牛特旗| 德庆县| 兴海县| 庐江县| 昭觉县| 侯马市| 平舆县| 全南县| 延吉市| 大方县| 东源县| 公主岭市| 元谋县| 綦江县| 宜兰县| 曲松县| 宣威市| 宜城市| 沙河市| 搜索| 萝北县| 古丈县| 光山县| 工布江达县| 平和县| 湘乡市| 长阳| 宝坻区| 潜江市| 泾源县| 高雄市|