centos7建立刪除軟連線
阿新 • • 發佈:2021-06-11
先建立一個軟連線
[[email protected] test ] # ls -il 總計 0 1491138 -rw-r–r– 1 root root 48 07-14 14:17 file1 1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2 1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand #建立file1和file1soft軟連線 [[email protected] test ] # ln -s file1 file1soft [[email protected] test ] # ls -il 總計0 1491138 -rw-r–r– 1 root root 48 07-14 14:17 file1 1491140 lrwxrwxrwx 1 root root 5 07-14 14:24 file1soft -> file1 1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2 1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
刪除上面建立的軟連線
[[email protected] test ] # ls -il 總計 0 1491138 -rw-r–r– 1 root root 0 07-1414:17 file1 1491140 lrwxrwxrwx 1 root root 5 07-14 14:24 file1soft -> file1 1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2 1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand #刪除軟連線 [[email protected] test ] # rm -rf file1soft [[email protected] test ] # ls -il 總計 0 1491138 -rw-r–r– 1 root root 0 07-14 14:17 file1 1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2 1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand 刪除軟連結 確實是用rm 但是!!! rm -fr xxxx/ 加了個/ 這個是刪除資料夾 rm -fr xxxx 沒有/ 這個是刪除軟連結