sed get from start until last match code example
Example: get file until match without including
sed '/[match]/q' file.txt
#Include q option at the end to grep until match only
sed '/[match]/q' file.txt
#Include q option at the end to grep until match only