german@Debian:~$ sed -e '1,/#An extra directory/d' -e '/For example/,20d' foo.lst 8 9 10 11 12 13 14 german@Debian:~$ cat foo.lst 1 2 3 4 5 6 #An extra directory 8 9 10 11 12 13 14 For example 16 17 18 19 20 german@Debian:~$