How to measure the total size of a fastq file in base pairs? Or Kbps/Gbps. It feels like it should be conceptually very simple, but I can't seem to figure out the right combination of keywords to find it via my search engine. Help would be appreciated!
I have BBMAP, SRAtoolkit and MEGAHIT already installed, and also use bash. I'd be very happy if this can be answered with software that I already have, but if not that's perfectly fine.
I've been using this:
cat file.fastq | paste - - - - | cut -f 2 | tr -d '\n' | wc -c 
Explanation :

paste - - - - : print four consecutive lines in one row (tab delimited), to merge the info for each read

cut -f2 : print only the second column, to access the sequence after the paste

wc -c : count the characters

tr -d '\n': to remove from count the eventual newline characters


(a tip for your googling: try search for &quot;counting number of bases in fastq file&quot;)