0

For example, I want c be copyed into ab/ not change a/b into a folder with c:

$ mkdir /a /b /ab /b/b
$ ln -s /ab /a/b
$ touch /b/b/c
$ ls -Rl
.:
total 12
drwxrwxr-x 2  a
drwxrwxr-x 2  ab
drwxrwxr-x 3  b

./a:
total 0
lrwxrwxrwx 1  b -> ab

./ab:
total 0

./b:
total 4
drwxrwxr-x 2 b

./b/b:
total 0
-rw-rw-r-- 1 c

I tried:

cp -rf /b/* /a/

cp: cannot overwrite non-directory ‘a/b’ with directory ‘b/b

even with flag -dHlLP dosent work.

4

1 回答 1

0

出于某种安全原因:

cp -rf b/* a/

给出:

cp: cannot overwrite non-directory `a/b' with directory `b/b'

所以你只能这样做来取消符号链接:

unlink a/b

然后

cp -rf b/* a/

一般来说,操作过多的目录结构是不好的,擦除文件的风险很大,如果你使用root /,风险更大,要避免。

于 2013-10-20T09:02:00.297 回答