On 10/29/2015 11:49 AM, Gustav Degreef wrote:
On 10/28/2015 08:39 PM, Bernhard Voelker wrote:
On 10/28/2015 08:01 PM, Gustav Degreef wrote:
I need to pipe the names and locations of files I find by:
find /home/username/folder -type f -name "*.doc"
to:
cp *.doc /home/username/doclist/ cp --help | grep -- --target -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY
Therefore, the command boils down to:
find /home/username/folder -type f -name "*.doc" \ | xargs cp -t /home/username/doclist/
or (for unlucky file names with blanks etc.)
Does not work. Result is:
find: paths must precede expression: Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression] cp: missing file operand
find /home/username/folder -type f -name "*.doc" -print0 \ | xargs -0 cp -t /home/username/doclist/
or even
find /home/username/folder -type f -name "*.doc" \ -exec cp -t /home/username/doclist/ '{}' + Also no. Result is: find: paths must precede expression: -exec Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
Have a nice day, Berny
Thanks for taking the time. Gustav.
I just tried the first 2 above and both of these work for me???? Mark -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org