Let's say I have a file file.txt
:
hello
world
hi
there
this
wow
I know sed can operate on one line like:
sed -n '2p' file.txt
or a range :
sed -n '2,4p' file.txt
but how to operate on one specific line plus a range ?
sed -n '1line and 4,5' file.txt
or in words print the first line and the range from 4th to 5th line ??