I have a directory with contains the following
ls
cat.txt mat.txt animal(directory) cat_bar.txt
ll
rwxrwxrwx 1 85594 16416 26 Feb 3 08:38 cat.txt -> animal/cat.txt
lrwxrwxrwx 1 85594 16416 53 Feb 3 08:38 cat_bar.txt -> sle12/cat_bar.txt
lrwxrwxrwx 1 85594 16416 43 Feb 3 08:38 mat.txt
drwxrwxr-x 2 85594 16416 4096 Mar 17 06:01 animal
when i give the find command as below
find . -iname "*cat*"
the output is
cat.txt
cat_bar.txt
./animal/cat.txt
./animal/cat_bar.txt
I could see that the file under animal directory is moved to the new temp directory, but symbolic links are not moved.
How can we move all the files including symbolic links
What I have tried:
Problem:
I want to move the result of find in a temporary folder, so i gave the below command
find . -iname "*cat*" | xargs mv -t /home/temp
Error. i get the below error
mv: will not overwrite just-created `/home/temp/cat.txt' with `./cat.txt'
mv: will not overwrite just-created `/home/temp/cat_bar.txt' with `./cat_bar.txt'
the solution i want is that the command should move both links and files to the new folder