Find files and copy the results to desired folder?
I'm trying to find files in a folder, say ones matching "acoustic" and then move all the results found into another folder.
I have done this to find the files: Code:
/media/seagate/guitar/tabstolearn > find -iname "*acoustic*" I have tried adding: Code:
find -iname "*acoustic*" | cp * Thanks for any help :) |
Code:
find /path/to -iname 'whatever' -exec cp '{}' /path/to/destination/ \; |
Thanks i92guboj, but I got this:
Code:
/media/seagate/guitar/tabstolearn > find -iname "*acoustic*" -exec cp '{}' test/ |
Ops, I missed the punctuation at the end of the command. Add "\;" to the end (without the quotes).
I also fixed the post above to avoid further confusion. |
Thanks so much! It works now :) :D
|
Hey i'm trying to add this to my .bashrc so I can make an alias, with the idea of something like
Code:
findcp string /desired/path Code:
alias findcp='find -iname "*$1*" -exec cp '{}' $2/ \; Code:
~/Desktop/new gdm > ls |
You want to look into functions, and not aliases.
|
All times are GMT -5. The time now is 03:02 PM. |