Hi

I have a folder with 4000 files in it. I would like make a new folder, and copy into it all of the files which contain >50 fasta sequences. How do I do this?

I know that I need to create a simple loop, then  grep '>'  | wc -l and select only those with >50. But I am new to programming and am unsure how to write this properly. 
Here is how


    grep -c '^>' *.fasta | sed 's/:/ /' | awk '$2>50 {print $1}' | xargs mv -t new_folder/

**Update**

    grep -c '^>' *.fasta | sed 's/:/ /' | awk '$2>50 {print $1}' | xargs cp new_folder/
    
    
P.S: Updated as @[genomax2][1] pointed out. 


  [1]: https://www.biostars.org/u/18713/