Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: find and copy

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    find and copy

    hey, trying to find files and copy to another folder, with 2 file extensions, dont know why its not working it is igoring the txt and just copying over doc, could someone take a wee look? -

    find $HOME -name "*.txt" -o -name "*.doc" -exec cp {} $HOME/test \;

    thank you

  2. #2

    Try wrapping the name parameters in (escaped) parentheses:
     find . \( -name '*.txt' -o -name '*doc' \) -exec ls -l {} \;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts