Solved

mail command

Posted on 2014-02-06
5
377 Views
Last Modified: 2014-02-25
I am new to mail command and I need help with mail command.

I did setup a cron job to run everyday.  When I tried to run mail command its shows
"/var/spool/mail/root": 2445 messages 2368 unread

How do i use this command to search better

I would really appreciate if someone can share the information.
0
Comment
Question by:ittechlab
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:savone
Comment Utility
Can you show us the command you are running?

What exactly are you trying to do?
0
 

Author Comment

by:ittechlab
Comment Utility
actually when i run mail command i see a list but if i want to see more what is the command
0
 

Author Comment

by:ittechlab
Comment Utility
how do i see more list
0
 
LVL 23

Expert Comment

by:savone
Comment Utility
Try the + and - signs
0
 
LVL 5

Accepted Solution

by:
Dave Gould earned 310 total points
Comment Utility
Once you've read your mails, you might want to avoid them in the first place!
You are probably getting them from the cron jobs as you do not redirect the output.
ie use something like this in your crontab:

10 * * * * your_script > log_file 2>&1
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now