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?

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
  • Thank You very much... I will use the sed as i wanted.. @Cyrus – Vishnu Nov 15 '15 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.