Mark Knecht <markkne...@gmail.com> writes: >> locate Correlation | grep Builder | grep csv | while read file; do >> cp "$file" ~mark/CorrelationTests; done
Just a minor point that would simplify the cmd by one cmd call. You could use awk instead of 2 calls to grep. It might be a tiny bit slower... but I doubt it would be noticeable at the proposed scale. awk is basic tool on linux for cmd line work... its quite a bit more powerful than grep, but of course more complicated. In this case though it would be a simple awk cmd. Instead of locate Correlation | grep Builder | grep csv | [...] You could use: locate Correlation | awk '/Builder/ && /cvs/'| [...] That should weed out the same files as the double call to grep