From "The Linux cookbook: tips and techniques for everyday use" by Michael Stutz
12.2.3 Listing Only the Unique Words in Text
Presuming there is no punctuations in your text files, the tr command could be :
tr -s '[:blank:]' '\n' <text |sort|uniq
So for solving your specific problem, you can use :
for file in *.fasta; do
nb=$(tr -s '[:blank:]' '\n' <$file |sort|uniq|grep -e LGIG -e HROB -e NVEC -e CAP|wc -l)
if [ $nb = 4 ]; then
cp $file <destination folder>
replace <destination folder> with the destination folder name without the '<' '>' characters.
Maybe some adjustments are to be made, but something along that line may solve your problem.