D.J. Lactose Productions

Email Results from the Command Line

If you have ever wanted to email yourself the results of commands you have run from the Linux Command Line, it is very easy.  This is especially great for reports.  All you need to do is make sure that sendmail on your box is setup to send mail and then you can just pipe your command to the mail command like below:

ls -lta | mail -s “LS of Directory” me@me.com

That will send an email to me@me.com with the subject of “LS of Directory” and it will have the results of the ls -lta on that directory.

Exit mobile version