Using find on subdirectories and create symlinks to all files

后端 未结 1 1111
[愿得一人]
[愿得一人] 2020-12-20 03:07

Ok, so I\'ve been trying to get my head around this, but I\'m struggling.

The premise is this: I have a directory with lots of subdirectories (some of which also con

相关标签:
1条回答
  • 2020-12-20 03:54

    How about using find?

    cd -- "$SOURCEDIR"
    
    find -type d -exec mkdir --parents -- "$DESTDIR"/{} \;
    
    find -type f -exec ln --symbolic -- "$SOURCEDIR"/{} "$DESTDIR"/{} \;
    
    0 讨论(0)
提交回复
热议问题