创建软连接
命令:
e.g.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| ➜ opt ll total 2.4M drwxrwxrwx 1 hadoop hadoop 4.0K May 7 13:58 redis-6.2.6 -rwxrwxrwx 1 hadoop hadoop 2.4M May 7 10:43 redis-6.2.6.tar.gz
➜ opt ln -s redis-6.2.6 ./redis
➜ opt ll total 2.4M lrwxrwxrwx 1 hadoop hadoop 11 May 7 13:59 redis -> redis-6.2.6 drwxrwxrwx 1 hadoop hadoop 4.0K May 7 13:58 redis-6.2.6 -rwxrwxrwx 1 hadoop hadoop 2.4M May 7 10:43 redis-6.2.6.tar.gz
|
删除软连接
命令:
e.g.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| ➜ opt ll total 2.4M lrwxrwxrwx 1 hadoop hadoop 11 May 7 10:45 redis -> redis-6.2.6 drwxrwxrwx 1 hadoop hadoop 4.0K May 7 10:43 redis-6.2.6 -rwxrwxrwx 1 hadoop hadoop 2.4M May 7 10:43 redis-6.2.6.tar.gz
rm -rf redis
➜ opt ll total 2.4M drwxrwxrwx 1 hadoop hadoop 4.0K May 7 10:43 redis-6.2.6 -rwxrwxrwx 1 hadoop hadoop 2.4M May 7 10:43 redis-6.2.6.tar.gz
|
NOTE:
特别注意 rm -rf redis
与 rm -rf redis/
命令之间的区别:
rm -rf redis
是仅删除软连接;
- 而
rm -rf redis/
是删除 redis
目录下所有文件,相当于删除目标文件夹 redis-6.2.6
下所有文件,谨慎操作。
(END)