This is a GNU
step'th line starting with line
first. For example,
sed -n 1~2p will print all the odd-numbered lines in
the input stream, and the address
2~5 will match every fifth
line, starting with the second.
first can be zero; in this
sed operates as if it were equal to
step. (This is an
Your two examples matches the same lines, but the first writes (
w) them to a file while the second prints (
p) them to wherever standard output is going.
In general, always refer to the manual of the command. The manual is seldom ambiguous. The application of a command by combining several aspects of its functionality may be difficult to explain in a tutorial sometimes (and sometimes a tutorial tries to make things easier to understand by rephrasing the same statement in many ways, which could lead to confusion), but the manual is the definite reference for each bit of what the aggregated command does.