我在Archive.folder
中有很多名为/var/CommuniGate/Accounts/*/
的文件夹。如何将它们移动到新位置,并在旧文件夹中将符号链接保留到新位置?
也许使用find和cp来移动它们?
find /var/CommuniGate/Accounts/ -name 'Archive.folder' -exec cp -r --parents {} . \;
这对于移动它们并保持文件夹结构非常有用。但是如何与ln同时保留链接?链接也应替换旧文件夹。
您可以将文件移动到所需位置,然后创建符号链接:
mv /var/CommuniGate/Accounts/Archive.folder* new_location/
ln -s new_location/Archive.folder* .