Tuesday, June 2, 2020

Linux - Search and Copy command

Problem: 

Find all XML files that start with word TEST and copy them to a directory

Command:

find . -iname 'TEST*.java' -exec cp {} ~/path/to/directory/. \;

Gotchas:

  • make sure the command ends with \; 

No comments:

Post a Comment