3 added 4 characters in body
source | link

To replace the part before @ (I think that's what you want), you could use:

sed 's/[^ ]\+@/admin@/g' file
  • s/old/new/ replace oldold with newnew
  • [^ ]\+@ match at least one non-whitespace character followed by @
  • g do the replacement on all matches, even if it occurs more than once on the line.

To replace the part before @ (I think that's what you want), you could use:

sed 's/[^ ]\+@/admin@/g' file
  • s/old/new/ replace old with new
  • [^ ]\+@ match at least one non-whitespace character followed by @
  • g do the replacement on all matches, even if it occurs more than once on the line.

To replace the part before @ (I think that's what you want), you could use:

sed 's/[^ ]\+@/admin@/g' file
  • s/old/new/ replace old with new
  • [^ ]\+@ match at least one non-whitespace character followed by @
  • g do the replacement on all matches, even if it occurs more than once on the line.
2 added 2 characters in body
source | link

To replace the part before @ (I think that's what you want), you could use:

sed 's/[^ ]\+@/admin@/g' file
  • s/old/new/ replace old with new
  • [^ ]\+@ match at least one non-whitespace character followed by @
  • g do the replacement on all matches, even if it occurs more than once on the line.

To replace the part before @ (I think that's what you want), you could use

sed 's/[^ ]\+@/admin@/g' file
  • s/old/new/ replace old with new
  • [^ ]\+@ match at least one non-whitespace character followed by @
  • g do the replacement on all matches, even if it occurs more than once on the line

To replace the part before @ (I think that's what you want), you could use:

sed 's/[^ ]\+@/admin@/g' file
  • s/old/new/ replace old with new
  • [^ ]\+@ match at least one non-whitespace character followed by @
  • g do the replacement on all matches, even if it occurs more than once on the line.
1
source | link

To replace the part before @ (I think that's what you want), you could use

sed 's/[^ ]\+@/admin@/g' file
  • s/old/new/ replace old with new
  • [^ ]\+@ match at least one non-whitespace character followed by @
  • g do the replacement on all matches, even if it occurs more than once on the line