find with redirected stdout find . -name '*.aln' | xargs -I {} sh -c 'cut -f 1 "$1" > "$1.cut"' -- {} This will find all files *.aln and then output the first column to *.aln.cut. get filetypes file *.stderr > file_types