2 added 156 characters in body
source | link

With GNU sed:

sed '1~4!d' < input > output

With standard sed:

sed -n 'p;n;n;n' < input > output

With 1 and 4 in $n and $i variables:

sed "$n~$i!d" # GNU only
awk -v n="$n" -v i="$i" 'NR >= n && (NR % i) == (n % i)'

With GNU sed:

sed '1~4!d' < input > output

With standard sed:

sed -n 'p;n;n;n' < input > output

With GNU sed:

sed '1~4!d' < input > output

With standard sed:

sed -n 'p;n;n;n' < input > output

With 1 and 4 in $n and $i variables:

sed "$n~$i!d" # GNU only
awk -v n="$n" -v i="$i" 'NR >= n && (NR % i) == (n % i)'
1
source | link

With GNU sed:

sed '1~4!d' < input > output

With standard sed:

sed -n 'p;n;n;n' < input > output