hey i wanted to share this because i've found it invaluable but would like take it 1 step further if someone could help.
after doing a search for files you can pipe the search results through other commands using what's called a subshell (a second running version of your shell)
for example if you try to pipe a your search results through cp it will complain that it is mising a parameter:
[root@itchy web]# locate filename.jpg) | cp $1 destination/
cp: missing destination file
Try `cp --help' for more information.
i tried using all sorts of ways to get cp to take a parameter but my linux knowledge is very limited
but if you put in this syntax it will work!:
cp $(locate filename.jpg) destination/
and all your files named filename.jpg will be hunted down and copied into destination/
i was trying to find a faster way copy the results of "ldd" so i wouldn't have to manually hunt down the files but using that same command results in this:
[root@itchy web]#cp $(ldd /usr/bin/scp) test/
cp: cannot stat `libcrypto.so.4': No such file or directory
cp: cannot stat `=>': No such file or directory
cp: cannot stat `(0x0459f000)': No such file or directory
i'm guessing because it is a link? any ideas how to copy the ldd results??