I have a directory named dir1
which has about 800 sub-directories named disp-001, disp-002, ... disp-800
. I get the list of sub-directories that does not contain a file stdout
based on solution given here as
$ find . -type d \! -exec test -e '{}/stdout' \; -print
I would now like to copy the sub-directories that do not contain the file into another directory dir2. I use xargs to accomplish this as
$ find . -type d \! -exec test -e '{}/stdout' \; -print |xargs -I cp -r {} ../dir2
However this throws me an error xargs: {}: No such file or directory
How can I copy these sub-directories to another directory