代码: 全选
mkdir x
ln -s x y
ln -s x y
求解,谢谢
代码: 全选
mkdir x
ln -s x y
ln -s x y
1. http://manpages.ubuntu.com/manpages/viv ... /ln.1.html为什么第二次执行时不提示文件存在
poloshiao 写了:1. http://manpages.ubuntu.com/manpages/viv ... /ln.1.html为什么第二次执行时不提示文件存在
By default, each destination (name of new link) should not already exist.
2. -f, --force
remove existing destination files
1. 表示 x 是 directorymkdir x
2. http://manpages.ubuntu.com/manpages/viv ... /ln.1.htmlln -s x y
不行啊,第一次ln -s 就乱了,x y 应该是平级的poloshiao 写了:1. 表示 x 是 directorymkdir x2. http://manpages.ubuntu.com/manpages/viv ... /ln.1.htmlln -s x y
ln [OPTION]... -t DIRECTORY TARGET... (4th form)
3. 試試
sudo ln -s -t x y
sudo ln -s -f -t x y
代码: 全选
ln -snf x y
-n, --no-dereference
treat LINK_NAME as a normal file if it is a symbolic link to a directory
1. http://manpages.ubuntu.com/manpages/viv ... /ln.1.htmlmkdir x
ln -s x y
susbarbatus 写了:x 是个目录,因此 y 是个指向目录的软链接,ln 默认的行为会 dereference 软链接,代码: 全选
ln -snf x y
因此第二次无论是 ln -s ... 还是 ln -sf ...,其效果都相当于 ln -s x x/,
目标是个目录的情况下,ln 的行为就是把链接建在目录下。
-n 可以取消 dereference 的行为:-n, --no-dereference
treat LINK_NAME as a normal file if it is a symbolic link to a directory