there are a bunch of filename.gif scattered in /home/ directories. I want all the filename.gif replaced by a /home/shared/filename_default.gif.
I tried something like
find /home/ -name "filename.gif" | xargs <cmd>
but I have no idea to reference what I want to. Wasnt sure to ask this here or stackoverflow
Edit:
This works exactly like I explained it, except I not only wanted the data from filename_default to replace filename.gif, but also for filename.gif to be renamed filename_default.gif. So I did mv {} filename_default.gif
and mv'ed all the files from their directories to /root/ under the name filename_default.gif ... lol. is there anyway to reference the changing variable in a directory..
for example find /home/ -name "filename.gif" was actually located like this...
/home/brian/dir/1/2/3/filename.gif
/home/beth/dir/1/2/3/filename.gif
/home/andrea/dir/1/2/3/filename.gif
How can I reference brian, beth, andrea... like a wildcard *.
cp /home/shared/filename_default.gif /home/*/dir/1/2/3/filename_default.gif