Friday, 9 August 2013

How to avoid 'are the same file' warning message when using cp in Linux?

How to avoid 'are the same file' warning message when using cp in Linux?

I'm trying to copy certain files from one directory to another. Using this
command
find "$HOME" -name '*.txt' -type f -print0 | xargs -0 cp -t $HOME/newdir
I get an warning message saying
cp: /home/me/newdir/logfile.txt' and/home/me/newdir/logfile.txt' are the
same file
How to avoid this warning message?

No comments:

Post a Comment