0

I have a file with this type of lines:

blabla bla:bla whatever what:ever
alpha bravo charlie
del:ta

I only want to keep the words that contain a colon.

So the output for the above would be:

bla:bla what:ever

del:ta

Does anyone have any ideas?

miono
  • 546
  • 2
  • 6

1 Answers1

1

grep -oE '\w+\:\w+' filename.txt

Chris S
  • 77,945
  • 11
  • 124
  • 216