A Linux mail command tip

If you're ever working on a Unix or Linux system, and need to email a file to someone else, it may be helpful to know that you can send your email message right from the Unix command line. You don't need to hop into mutt or any other Unix or Linux mail client to email the file.

Here's a simple one-line example where I use the Unix/Linux mail command to email a file to the email address "kim@example.com". In this example, the subject of the message is "Some important information", and the file I'm attaching is named ImportantFile.txt:

mail -s "Some important information" kim@example.com < ImportantFile.txt

Assuming all your email plumbing infrastructure is set up properly, the email message will appear to the recipient as though it came from your current user account on the Unix or Linux system you're sending the message from. If your email infrastructure isn't set up right ... I suppose that's a subject for a much longer tutorial, lol.