Results 1 to 2 of 2
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, ...
- 11-24-2011 #1Just Joined!
- Join Date
- Nov 2011
- Posts
- 3
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
- 11-25-2011 #2Linux Guru
- Join Date
- May 2011
- Posts
- 1,838
Hey,
Try wrapping the name parameters in (escaped) parentheses:
Code:find . \( -name '*.txt' -o -name '*doc' \) -exec ls -l {} \;


Reply With Quote