All Linux HowTo's

Tired of waiting, have the results emailed to you

Some commands take longer to complete than your willing to wait. In times like this you can have the results emailed to you with this very simple trick. Here’s a basic example:

echo "apples" | mail -s "test" me@example.com -

The above would send the email right away with the word “apples” in it. But if the command was something more time consuming such as searching for a string within a bunch of files, you might do this:

grep -i "needle" * -R | mail -s "test" me@example.com -

And then go have a drink and wait for the email.

Similar Posts: