0

I have a file contain lines like the following.

10   TEST   NO   SOMETHING 
20   TEST   YES  SOMETHING 
101  TEST   YES  SOMETHING 
100  TEST   NO   SOMETHING

How can I delete only the line that has 10 at the beginning using sed or any other tool if I find a matching word 10?

Cyrus
  • 927
  • 1
  • 7
  • 15
Vishnu
  • 711
  • 2
  • 8
  • 15

1 Answers1

2
sed '/^10[^0-9]/d' file

If you want to edit file "in place", add sed's option -i.


grep -v '^10[^0-9]' file
Cyrus
  • 927
  • 1
  • 7
  • 15