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.) 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/ '{}' + Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org