我正在尝试运行 rsync 以根据文件名模式(不区分大小写)沿路径递归复制一些文件。这是我为运行 rsync 所做的:
$ rsync -avvz --include ='*/' --include='.*[Nn][Aa][Mm][E].*' --exclude='*' ./a/ ./b/
Run Code Online (Sandbox Code Playgroud)
没有被复制,调试输出显示:
[sender] hiding file 1Name.txt because of pattern *
[sender] hiding file 1.txt because of pattern *
[sender] hiding file 2.txt because of pattern *
[sender] hiding file Name1.txt because of pattern *
[sender] hiding directory test1 because of pattern *
[sender] hiding file NaMe.txt because of pattern *
Run Code Online (Sandbox Code Playgroud)
我试过使用: --include='*[Nn][Aa][Mm][E]*'和其他组合,但还是不行。
关于如何使用正则表达式包含一些文件的任何想法?