Linux: Copy all files by extension to single dirrectory

Use find for this find . -name "*.TIF" -exec cp {} new \;

So find is used to find files. The command is saying find files starting from here . where the name of the file -name ends in .tif remember the double quotes for shell expansion. So to find all the tif files is simply.

find . -name "*.tif"
./2/3/3.tif
./2/2.tif
./1.tif

We then use -exec to do something with files in this case cp found files {} to the target directory new followed by an escaped semicolon \;


It should be like this. You have to enter old directory:

cd old
cp -R *.tif ../new