Thursday, May 2, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 510  / 3 Years ago, wed, may 5, 2021, 9:19:01

I am trying to learn about the find command. I would like to understand the meaning of this warning:



ankit@battlestar:/home/mount_150/studies$ find -iname "*.pdf" -exec cp -ar {} lcommands/  ;
cp: `./lcommands/june.pdf' and `lcommands/june.pdf' are the same file
cp: `./lcommands/cde.pdf' and `lcommands/cde.pdf' are the same file
cp: `./lcommands/abc.pdf' and `lcommands/abc.pdf' are the same file
ankit@battlestar:/home/mount_150/studies$ ls -l lcommands/


You can see here the procedure I followed and the directory structure:



enter image description here


More From » command-line

 Answers
3

find command would also search in the lcommand directory for any instances of the pdf files. Since the files were copied the pdf files were copied to the directory; find came up with the warning.


[#36377] Friday, May 7, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ttarum

Total Points: 417
Total Questions: 101
Total Answers: 115

Location: Maldives
Member since Wed, Nov 4, 2020
4 Years ago
;