only output the nth line

Jozsi Vadkan jozsi.avadkan at gmail.com
Wed May 12 16:58:56 UTC 2010


I have a file:

cat file.txt
daemon
1):
596
0
0
1
0
0
bin
2):
12
0
0
1
0
0
sys
3):
0
0
0
0
0
0



And i want to only output the first, second, and fourth line to another
file.

The:

sed -n '1,2p;4p' file.txt

doesn't work.

What magic do i need for it? :D

Thanks..:\





More information about the ubuntu-users mailing list