Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Linux shell 中,如何将所有文件复制/folder到/folder/sub?
/folder
/folder/sub
递归复制的正常方式不起作用(这是有道理的),因为我正在将文件夹复制到自身中......
cp -a !(sub) sub
您可以排除子目录。
从对类似问题的评论中:
如果这不起作用,您可能需要启用:
shopt -s extglob