Error using "find" command

Need support for GhostBSD. Ask here if your question does not fit elsewhere.
Post Reply
ninjaradiopin01
Posts: 3
Joined: Sun Sep 29, 2024 1:22 pm

Error using "find" command

Post 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.
User avatar
ericbsd
Developer
Posts: 2123
Joined: Mon Nov 19, 2012 7:54 pm

Re: Error using "find" command

Post 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.
ninjaradiopin01
Posts: 3
Joined: Sun Sep 29, 2024 1:22 pm

Re: Error using "find" command

Post by ninjaradiopin01 »

Thank you, ericbsd, I will look at the link you posted.

Best regards.
Post Reply