Skip to main content

I just read this on a forum (link below) and it’s genius! Let’s say you need to copy all the .log files (and only the .log files) from within a bunch of directories to a /log directory. This is actually a pain in the ass. Check this out:

cp $(find . -name “*.log”) /log/

GENIUS!

Ref link: http://www.linuxquestions.org/questions/linux-general-1/useful-shortcut-pipe-results-of-search-to-cp-295092/