سؤال

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