Page 1 of 1

Error using "find" command

Posted: Sun Sep 29, 2024 2:18 pm
by ninjaradiopin01
Greetings,

I am trying to use the following command to find and copy all my photos from an external hard drive to the Pictures directory.

find /media/da2s1/ -name "*.jpg" | xargs cp -t /home/ghost/Pictures/

The terminal is returning the following error:

cp: illegal option -- t
usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] source_file target_file
cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] source_file ... target_directory

It is my understanding that the option "-t" directs the output to the target /home/ghost/Pictures/ but in the above error message, the "-t" is not listed. Is the "-t" not required?

Thank you in advance.

Re: Error using "find" command

Posted: Sun Sep 29, 2024 4:13 pm
by ericbsd
FreeBSD does not have t options. For more information, see the cp man on the system or here: https://man.freebsd.org/cgi/man.cgi?query=cp.

Re: Error using "find" command

Posted: Mon Sep 30, 2024 10:58 pm
by ninjaradiopin01
Thank you, ericbsd, I will look at the link you posted.

Best regards.