Hello Bharath,
You might want to include a ^ at the beginning of those search strings so it's only checking the beginning of the sequence, for instance:
macqiime grep -c "^TCTGT" HernandezV1V2_S1_L001_R2_001.fastq
As some of the counts may simply be random chance from the middle of the sequences.
In any case, although it's not QIIME supported, here is a simple parser for pulling off the first X base pairs of a fastq file and writing those X base pairs to one file (the barcode read file) and the remaining sequence to a second file (read file). As it uses a PyCogent library, you'll need to be in the macqiime environment to run it.
Usage:
python parse_bc_reads.py X Y Z A
where X is the file path of the fastq sequence to parse
Y is the output filepath for the barcode reads
Z is the output filepath for the rest of the sequence after barcode has been trimmed off
A is the length of your barcodes.