Skip to content
Advertisement

Removing specific string from lines in file using sed

I have a file like so:

asdsdf
www.sdf
wwwasdsdsds
gegergreg

I want the following output:

asdsdf
sdf
wwwasdsdsds
gegergreg

What I tried is:

sed '^www.'/d myfile.txt

But this is not what I want…

Advertisement

Answer

Try this way

 sed 's/^www.//' FileName
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement