sed can also work on pattern ranges. To print from lines between patterns root and dmitritelinov:
To print the lines from pattern dmitritelinov till the end of the file:
sed -n '/root/,/dmitritelinov/p' /etc/passwd
Similarly, to print contents from the beginning of the file till the pattern dmitritelinov:
sed -n '/dmitritelinov/,$p' /etc/passwd
sed -n '1,/dmitritelinov/p' /etc/passwd