Linux, find and gzip a bunch of files frankie - 24 Oct 2022 You just leverage the find command:find . -name "*.csv"Traverses all directories from your current working dir and lists the matching filesWith the gzip command:gzip -v -k -9 filename -v = verbose -k = keeps file (default is to zip and delete old) -9 = compression, default 6, 9 max compressiongzips filenameAnd then you mix the two:find . -name "*.csv" -exec gzip -v9 {} \;This command finds all your files ending in ".csv" and gzips themYou should also be aware of pigz, a drop-in replacement for gzip, present in most distros, that (p)arallel gzips your files. For multicore systems, this will yield massively superior results:find . -name "*.csv" -exec pigz -v9 {} \;Look at all those cores humming!