我正在尝试将一堆文件复制到目录下,并且许多文件的名称中都有空格和单引号.当我尝试串联find和grep使用时xargs,我收到以下错误:
find .|grep "FooBar"|xargs -I{} cp "{}" ~/foo/bar
xargs: unterminated quote
Run Code Online (Sandbox Code Playgroud)
有关更强大的xargs使用的任何建议?
这是在带有BSD的Mac OS X 10.5.3(Leopard)上xargs.
为什么以下不将文件复制到目标文件夹?
# find /home/shantanu/processed/ -name '*2011*.xml' -exec cp /home/shantanu/tosend {} \;
cp: omitting directory `/home/shantanu/tosend'
cp: omitting directory `/home/shantanu/tosend'
cp: omitting directory `/home/shantanu/tosend'
Run Code Online (Sandbox Code Playgroud)