I have a txt file
123
456
789
456
123456
I want to delete specific characters from the file i.e (123). I tried with
$ sed -i '/123/d' dummy.sh
$ vi dumm.txt
456
789
456
In the below command when I run both the words (123
and 123456
) are getting deleted but I need to delete only 123
from the file
$ sed -i 's/123//g' dummy.sh
$ vi dumm.txt
456
789
456
456
when I run the below command the 123
is getting replaced with null.
Can anyone say how to delete a whole line if it contains only specific number?
grep
if you use is like that. But it can be superior for some tasks due to it's options:grep -xv 123