How can I remove every odd line, using sed?
remove
keep
remove
keep
remove
...
How can I remove every odd line, using sed?
remove
keep
remove
keep
remove
...
Here is the shortest I can think of:
sed -n 'g;n;p' file
It should work with non-GNU versions of sed
(as well as GNU sed
).