Q:

How can I use sed to remove all characters before a specific symbol?

I have a text file and I need to get rid of all characters before the equals symbol in each line, for example:
The line:
File 1515 = foo.txt

needs to look like this:
=foo.txt

I tried this sed command:
sed s/=[^=]*^// everyone.pls

but it deletes all the characters after the equals symbol.
How can I delete the characters before =?

A:

To delete everything before the first equal sign:
sed 's/^[^=]*=/=/' everyone.pls

If the file everyone.pls looks like:
$ cat everyone.pls
File 1515 = foo.txt
File 1516 = foo=.xls

The the above command produces:
$ sed 's/^[^=]*=/=/' everyone.pls
= foo.txt
= foo=.xls

In the regex ^[^=]*=/, the leading caret means that the regex has to match starting at the beginning of the line.  The expression [^=]*= matches every character up to and including the first equal sign.   Because we want the equal sign in the output, we need to substitute for all that an equal sign.

A:

You can use
sed 's/.*=/=/g' everyone.pls

to remove the characters before =

