sed and grep save the day

I use thunderbird for one of my less recently used email accounts – I get a lot of spam.

I was trying to use a website to fill in a survey  but I forgot my password so they emailed it to this email account.

Of course the email goes straight into the spam folder.  This is rather large and I cannot browse it.

Easy solution: copy  the Junk file to my linux box.

Find the location in the file of the retailer:

grep -in retailer Junk

This lists the location in the file of the retailer.

The first entry was on line 920123 

sed -e”1,920000d” Junk > Junk.tail

I can now edit Junk.tail and find the temporary password.

Can you find a quicker solution? 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s