I have a directory of FASTA files, some of which are empty (placeholders that were output from a pipeline) and I would like to delete the empty files using a for loop on the command line.
From what I have seen so far I can use the
wc -l [file] approach to see "if there are lines present, delete the file" but I want to make sure the syntax is right before deleting important files. I was thinking it might be easier for the command to look for the " > " symbol found at the header in FASTA files and if it's not present delete the file.
Here is what I have so far:
for file in *.fasta; do "if wc -l < 1 rm file"; done
for file in *.fasta; do "grep > | rm file"; done