我有一个文件夹 folderA/
和一个空文件夹 folderB/
folderA/
file1
file2
file3
...
folderB/
如何在 folderB/
中为 folderA/
中的每个文件创建符号链接,而无需单独链接每个文件?有很多文件。使用 bash,Ubuntu 20.04。
我发现了几个关于在文件上运行批处理的问题,但我无法让它们中的任何一个适用于这种特殊情况。
编辑
我在这里尝试了答案:https://superuser.com/a/429508
来自folderA/
:
ln -s * /path/to/folderB/
它在 folderB/
中创建了符号链接循环:
folderB/
file1 -> file1
file2 -> file2
file3 -> file3
...
符号链接链接到自身,而不是链接到 folderA/
中的文件。