Getting error “xargs unterminated quote” when tried to print the number of lines in terminal

后端 未结 4 1165
情书的邮戳
情书的邮戳 2021-01-31 02:57

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
4条回答
  •  长发绾君心
    2021-01-31 03:35

    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.

提交回复
热议问题