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 '20 at 13:34
  • @ankx7 can you share the output you are expecting .. – codeholic24 Dec 20 '20 at 15:36

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

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

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.