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.
我有一个目录结构,其中包含可变数量的子目录和文件。我想排除除 1 子目录树之外的所有内容。
我努力了
rsync -a --include 'wanted_dir' --exclude '*' 1/ 2/
但它只给了我wanted_dir目录(它下面没有文件)。
wanted_dir
要包含目录中的所有文件,请添加三颗星:
rsync -a --include 'wanted_dir/***' --exclude '*' 1/ 2/
将它添加到包含目录不是更有意义吗?
rsync -a --include 'wanted_dir/1/'
您的代码中发生了什么使您需要包含根目录?