Help for this page

Select Code to Download


  1. or download this
    $ sed -n 10,20p somefile
    $ sed -n 40,/foo/p somefile
    $ sed -n /foo/,/bar/p somefile
    
  2. or download this
    $ perl -ne'print if 10 .. 20' somefile
    $ perl -ne'print if 40 .. /foo/' somefile
    $ perl -ne'print if /foo/ .. /bar/' somefile