Artificial intelligent assistant

How to get the line number of those lines that have a specific character? I have a population file, looks like this: Pop_ID good HA_27 HA_14 HA_1 HA_20 HA_17 HA_26 HA_22 HA_7 HA_7 HA_16 HA_14 HA_2 HA_1 HA_11 HA_3 HA_7 HA_25 HA_23 I want to print the line number of those lines that has a specific character. For instance, "`HA_1`" where lines 5 and 15 have this character. 5 15

With `awk`.


awk '/\/{print NR}' infile


With `sed`.


sed -n '/\/=' infile

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 49227256e33cdb6b3d948e9d7b92788e