I want to get the number of lines in my application. I am using this code:
find . \"(\" -name \"*.m\" -or -name \"*.h\" \")\" -print | xargs wc -l
After some tinkering, I found that this command worked for me (because I had spaces and unmatched quotations in my filenames):
find . -iname "*USA*" -exec cp "{}" /Directory/to/put/file/ \;
.
refers to the location the search is being run
-iname
followed by the expression refers to the match criteria
-exec cp "{}" /Directory/to/put/file/ \;
tells the command to execute the copy command where each file found via -iname
replaces "{}"
You need the \;
to denote to the exec command that the cp
statement is ending.