I want to remove the second line of several files (there are like 200). All files begin with Glo so i want to do a command or a shell to remove all second lines for that file:

Example:

Glo1:
1 AAA
2 BBB
3 the third line

Glo2:
1 DDD
2 RRR
3 the third line

What i want is to delete only the second line, so files will look like this:

Glo1:
1 AAA
2 the third line

Glo2:
1 DDD
2 the third line

Regards!

有帮助吗?

解决方案

Since you mentioned using a shell:

sed -i '3d' Glo*
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top