Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting mails from commnad line?

Status
Not open for further replies.

alphaaa

Technical User
Jan 15, 2002
45
US
How do i delete my mails from command line. Is there a command that will delete mails or anyother way around for deleting mails. I'm using sendmail on solaris.
 
On the command line:
# mail

U will get mail prompt.
keep on typing d for every mail u want to delete.
After u r done, type q to quit from the mail prompt.

Regds,

- Hemant
NSIG,
Satyam Computer Services Ltd
 
on solaris:
ls /var/mail
rm /var/mail/WHAT-YOU-WANT -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
you can also enter:
mailx
d *
q

This will delete all mail messages
 


I am partial to

yes d | mail > /dev/null

Yes is a program which echos its input as often as the other side posts a read. therefore this will delete all the mailgrams in the mailbox.

 
'yes'...?

I can only find it on a Solaris 9 box... Does it exist on any older versions? Adam F
Solaris System Administrator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top