Print Particular Lines of a File Using SED

Say you want to print the lines 3 and 7, and all lines from 11 to 15 of a text-file. The following SED one-liner will do for you

sed -n -e '3p' -e '5p' -e '11,15p' textfile.txt

One Response to “Print Particular Lines of a File Using SED”

  1. Also wie am Samstag angesprochen. Ich finde nicht wo du die 7te Zeile angibst oder mit was. Würde mich mal interessieren. Bis dahin
    Viele Grüße
    Carsten

Leave a Reply