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" [email protected] -
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" [email protected] -
And then go have a drink and wait for the email.