I’ve long been wondering about this question;
say I first try to grep some lines from a file:
cat 101127_2.bam |grep 'TGATTACTTGCTTTATTTTAGTGTTTAATTTGTTCTTTTCTAATAA'
Then it’ll pop out the whole line containing this string.
However, can we use some simple bash code to locate at which line this string locates? (100th? 1000th?…)
I found it using
man grepand writing/line number// EDIT: Thanks @Keith Thompson I’m editing post from
cat file | grep -n patterntogrep -n pattern file, I was in a hurry sorry