Read and manage mail under Terminal

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Read and manage mail under Terminal
# 1  
Old 12-01-2011
Read and manage mail under Terminal

When opening Terminal window under Mac OS Lion, I have a message saying I've got mail . It seems to be somewhere close to ~/Library/Server/Mail/Data/spool/ but I ignore what command to be typed in order to read it and suppress it later once read.
# 2  
Old 12-03-2011
You can use the mail command to read the mail, and while in it use the d option to delete the mail. The mail file is in /var/mail/$LOGNAME, so alternatively you can trash it all by adding this to your .profile:
Code:
> /var/mail/$LOGNAME

The only way I could suppress the message completely when opening Terminal, was to run touch ~/.hushlogin once, but that suppresses every login / profile message (including, for example, the MOTD).

In your profile, you can add unset MAILCHECK to prevent any new mail messages appearing while you are using Terminal.

HTH
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Mail not sent through terminal

The Mail not sent through terminal by using following command, mail -s " check " upload.xxx@example.com> msg.txt By listing the location of following ouputs,Please check this # ls -ld / /etc/ /etc/mail drwxr-xr-x 30 root root 4096 Sep 18 17:56 / drwxr-xr-x 89 root root 12288 Sep... (14 Replies)
Discussion started by: kannansoft1985
14 Replies

2. Solaris

Manage ILOM password from terminal

Hi, I have T5240/M9000 servers running Solaris 10. I want to manage root password from terminal only using scadm command. Can somebody help me on this? Which package do I need to install and what all configuration need to be done? Thanks, Prashant (1 Reply)
Discussion started by: prashant2507198
1 Replies

3. UNIX for Dummies Questions & Answers

Sending Mail in OS X Terminal

Hi All! I would like your assistance with an issue that I have been having with OS X (Snow Leopard 10.6.8) and sending mail through the Terminal. I had been trying to send mail from Terminal to my GMail account from my home, where I have a Verizon DSL Internet connection routed through a... (0 Replies)
Discussion started by: danielsutton
0 Replies

4. Shell Programming and Scripting

script to read mail on a mail server

Hi All, Is there any way Unix shell script can directly read a mail on a mail server (for eg. abc@xyz.com) and save it as a text file in a unix directory ? Thanks PRKS ---------- Post updated at 08:37 AM ---------- Previous update was at 08:36 AM ---------- I am using ksh (1 Reply)
Discussion started by: PRKS
1 Replies

5. UNIX for Dummies Questions & Answers

How do I read mail in /var/spool/mail?

How can I read mail sent to /var/spool/mail? I do not have pine installed so forget about that...is there some generic utility I can use? (3 Replies)
Discussion started by: mojoman
3 Replies

6. Programming

How to read terminal attributes using ioctl()

I want to get the terminal attributes such as , terminal width terminal height current cursor position Can I use ioctl function. Please help me how to use this function to get these details.. If possible please explain with a sample code. I'm very new to UNIX progrmming.... Thanks... (1 Reply)
Discussion started by: Sreejesh.S
1 Replies

7. Programming

read terminal command

hi how to read terminal command, just i want to read all command which write on terminal so please tell me any system call, api avilable in c for above purpose (6 Replies)
Discussion started by: munnu
6 Replies

8. UNIX for Dummies Questions & Answers

Manage Mail

I have recently taken over a UNIX system from another programmer and am just beginning to learn UNIX. When I enter the MAIL command, the data scrolls off the screen for five minutes. Some of it is several years old. Can I tell the MAIL command to give me the last few items or the last few... (1 Reply)
Discussion started by: SUSANR9999
1 Replies

9. Shell Programming and Scripting

read from terminal

If I do: cat file | write user I can cat a file to a users terminal. My question is, how can this user read the input and cat it into a file? I tried the reverse: read | file or read > file etc. But it didn't work. (1 Reply)
Discussion started by: rein
1 Replies

10. Shell Programming and Scripting

Terminal Hungup at the time of read

Hi, There are two scripts. The second script is called from the first one. These will create two processes on unix. In the second script, there is a read statement in the while loop. Under unexpected conditions, at the time of reading response from the user, if the terminal hungup happens,... (1 Reply)
Discussion started by: pkusumam
1 Replies
Login or Register to Ask a Question