I have lines like this:

Sun Apr 19 13:02:34 2020 us=73808 pinco.pallino/ [pinco.pallino] Inactivity timeout (--ping-restart), restarting

Can I use sed, or another program, to delete all characters between a / and the next space (in this case pinco.pallino)? I've tried more regex combinations but I've not found the correct one!

Thanks in advance

  • 2
    Please edit your question and show us the output you expect from this input. Your description isn't very clear.
    – terdon
    Apr 20, 2020 at 13:34
  • @ankx7 can you share the output you are expecting .. Dec 20, 2020 at 15:36

1 Answer 1


Replace a slash and everything following, that is not a space with empty replacement:

sed 's+/[^ ]*++g'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .