grep grep match, and 4 charactors cat 1 | grep -o 'JVID=: [a-z]{4,}' all matches cat 1 | grep -o 'VID=: [A-z]*'