May 22, 2022

You can use the following code to find files of a certain type, on Linux, and copy all of them to a new location. In the example below all “.tar” files are copied to /newfolder:

find /root -iname "*.tar" -execdir cp '{}' /newfolder/ \;


Slightly different syntax which, as I recall, works on newer versions of Linux:

find /usr/share -name '*.png' -exec cp  {} /home/guy/PNG \;

Leave a Reply

Your email address will not be published.