delete strings after match to eol using sed command
# You can use awk's field separator (-F) following way:
$ cat file
google.com/funny
unix.stackexchange.com/questions
isuckatunix.com/ireallydo
delete strings after match to eol using sed command
# You can use awk's field separator (-F) following way:
$ cat file
google.com/funny
unix.stackexchange.com/questions
isuckatunix.com/ireallydo
delete strings after match to eol using sed command
$ cat file | awk -F '\\.com' '{print $1".com"}'
google.com
unix.stackexchange.com
isuckatunix.com
delete strings after match to eol using sed command
# To explicitly delete everything that comes after ".com", just tweak your existing sed solution to replace ".com(anything)" with ".com":
sed 's/\.com.*/.com/' file.txt
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us