To fetch lines that are a subset of the lines in the file, with known, but different, starting characters, write this:
more <filename.txt> | grep "^1 \|^101 \|^251 "
where 1, 101 and 251 followed by a space represent the start of the lines we are interested in. In other words, the operator OR “|” must be escaped using the “\”.

Advertisements