OpenWindows Advanced User's Guide

7.3 Deleting (and Undeleting) Letters

When you are finished reading a letter, you may decide you want to delete it rather than have it saved to your mbox file (the default when you quit the mailx program).

To delete the last letter you read, just type d at the mailx prompt. To delete a specific letter from your mailbox, use the command form:

d number

For example, to delete the second letter, give this command from within mailx:

& d 2

You can also delete several letters at a time. To delete letters 1 and 3, give the command:

& d 1 3

To delete a range of letters, for example 1 through 3, give the command:

& d 1-3

Before quitting mail, you can undelete letters you've removed from your mailbox. Use the command form:

u number

followed by Return. For example, to undelete the second letter, give this command:

& u 2

If you want to undo your last deletion, just type u at the mailx prompt immediately after the deletion. For example, if your last deletion command was d 2-5, typing u will undelete messages 2, 3, 4, and 5.

Note that all deletions are made permanent when you quit mailx with the q command; that is, deleted letters can no longer be undeleted. You can, however, quit mailx with the x command, leaving your mailbox intact -- as mentioned previously, quitting with x will leave read letters marked with a U, deleted letters undeleted, and so forth.