【发布时间】:2014-05-18 21:11:09
【问题描述】:
我想递归地复制一个目录的内容,该目录包含符号链接(符号链接)以及带有 Bash / Shell 脚本的普通文件。我不知道如何复制符号链接内容。伪代码看起来像这样:
for file in directory do
if is symlink
resolve symlink and copy its contents
else
copy the file / folder
我的目录结构如下所示:
base/
dir1/
symlinkdir1*/ (--> ../somewhere/else/dirA)
/file1
/file2
symlinkdir2*/ (--> ../somewhere/else/dirB)
/file3
/file4
…
在复制过程之后,我想要一个这样的目录结构:
base/
dir1/
symlinkdir1/ (no symlink, actual directory)
/file1
/file2
symlinkdir2/ (no symlink, actual directory)
/file3
/file4
…
【问题讨论】:
标签: bash shell terminal copy symlink