Search code examples
imagetiff

Control file order with tiffcp


I want to use my tried-and-true script to combine all tif in a directory into a single multipage tiff

tiffcp *.tif out.tif

but I want the files in the reverse of alphabetical order, e.g. 003.tif, 002.tif, 001.tif. Is there a flag in tiffcp? Do I need to rename all the files?


Solution

  • You can do this with some bash:

    tiffcp `echo *.tif | sort -r` out.tif