grep -l -r "TWL" --exclude=*.csv* | xargs cp -t ~/data/lidar/tmp-ajp2/
Explanation:
- grep
-loption to output file names only - xargs to convert file list from the standard input to command line arguments
- cp
-toption to specify target directory (and avoid using placeholders)