Solved

How to delete mail I got?

Posted on 2000-03-14
4
323 Views
Last Modified: 2013-12-06
How can I  delete mail after reading , which is very very long?
0
Comment
Question by:clemend
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
tfewster earned 30 total points
ID: 2617169
If you're just using the unix command "mail" to read your mail, type "d" at the ? prompt to delete the item you've just read.

If you've got lots of old messages that you don't want to re-read and delete individually, cd to /var/mail and do "cat /dev/null > your_user_name" - This will destroy all your mail messages & leave you with an empty mail file.
0
 
LVL 5

Expert Comment

by:paulqna
ID: 2617353
Prefer this one (looks safer to me):

/ # >/var/mail/<username>

This will empty the user's mailbox.

or edit the mailfile with vi, and delete eg 500 lines with "d500".
0
 
LVL 12

Expert Comment

by:tel2
ID: 2618947
Or, if you want to delete say message numbers 5 to 600, type:
  d5-600
at mail's "?" prompt.
0
 
LVL 21

Expert Comment

by:tfewster
ID: 2619215
clemend, it would help if you told us which Unix you use, plus which mail
reader...

Assuming it's the "mail" command:
If you have lots of messages, some of which you want to keep, you can list just the headers by using "mail -h" (On AIX "mail -H", but AIX displays just the headers by default). From the list, you can select which messages to delete.

Typing "?" at the mail "?" prompt will bring up the help screen. The command "man mail" will tell you more about the command line options.


If you want to empty the whole mail file, /var/mail is the right directory for Solaris & HP-UX; On AIX it's /var/spool/mail; On further thought, you can just delete your mail file - it gets recreated correctly the next time you get mail.

paulqna, the mail file must start with a valid "From " line on Solaris, so after deleting e.g 500 lines, you should do "d/From " - Note the space after the word "From", to distinguish it from "From:" :)

tel2, AIX obviously has a more flexible mail client than the basic Solaris 2.7 client, which doesn't allow you to specify a range :(
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AIX    Volume group Auto ON/OFF question 2 149
reinstall 1 97
dot directory in FreeBSD??? 4 102
looking for unix program to search some keywords in side EAR WAR and JAR files 10 122
When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

751 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