xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Linux shell command symbolic link & soft link All In One

Linux shell command symbolic link & soft link All In One

symbolic link / 符号链接

soft link 软链接 === symbolic link / 符号链接

hard link 硬链接

$ man ln

# 默认 hard link
$ ln
$ ln -h

# soft link
$ ln -s

demos

hard link vs soft link / symbolic link

pi@rpi3b:~/Desktop/links $ ln /home/pi/Desktop/links/student.sh /home/pi/Desktop/links/hard
pi@rpi3b:~/Desktop/links $ /home/pi/Desktop/links/hard
student origin
pi@rpi3b:~/Desktop/links $ ls -al
总用量 16
drwxr-xr-x  2 pi pi 4096  6月  5 23:30 .
drwxr-xr-x 12 pi pi 4096  6月  5 23:17 ..
-rwxr-xr-x  2 pi pi   43  6月  5 23:20 hard
-rwxr-xr-x  2 pi pi   43  6月  5 23:20 student.sh
pi@rpi3b:~/Desktop/links $ ln -s /home/pi/Desktop/links/student.sh /home/pi/Desktop/links/soft
pi@rpi3b:~/Desktop/links $ /home/pi/Desktop/links/soft
student origin
pi@rpi3b:~/Desktop/links $ ls -al
总用量 16
drwxr-xr-x  2 pi pi 4096  6月  5 23:31 .
drwxr-xr-x 12 pi pi 4096  6月  5 23:17 ..
-rwxr-xr-x  2 pi pi   43  6月  5 23:20 hard
lrwxrwxrwx  1 pi pi   33  6月  5 23:31 soft -> /home/pi/Desktop/links/student.sh
-rwxr-xr-x  2 pi pi   43  6月  5 23:20 student.sh
pi@rpi3b:~/Desktop/links $ 

image

https://github.com/xgqfrms/linux-shell-script-programming/issues/3#issuecomment-1577026893

npm link

$ npm link [<package-spec>]
# alias: ln

$ cd ~/projects/node-redis    # go into the package directory
$ npm link                    # creates global link

$ cd ~/projects/node-bloggy   # go into some other package directory.
$ npm link redis              # link-install the package

https://docs.npmjs.com/cli/v9/commands/npm-link

https://zzk.cnblogs.com/my/s/blogpost-p?Keywords=npm link

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

bash

image

https://tinylab.gitbooks.io/shellbook/content/zh/chapters/01-chapter1.html

http://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.html

https://github.com/wzb56/13_questions_of_shell/blob/master/1.何为shell.md

refs

https://en.wikipedia.org/wiki/Symbolic_link

https://en.wikipedia.org/wiki/Ln_(Unix)

https://stackoverflow.com/a/1951752/8629798

https://www.tecmint.com/create-hard-and-symbolic-links-in-linux/

https://www.cyberciti.biz/faq/creating-soft-link-or-symbolic-link/

https://kb.iu.edu/d/abbe



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2018-07-04 10:58  xgqfrms  阅读(245)  评论(2编辑  收藏  举报