Solaris Advanced User's Guide

Tilde Commands

In the course of composing a message, you can use tilde commands to perform a variety of functions. Tilde commands usually consist of the tilde character (~) followed by a single character. The following table describes some of the more useful tilde characters. Some of these characters have already been introduced in this chapter.

Note –

If you want to include a literal tilde character in a message, type two tildes in succession. Only one tilde is displayed.

Table 7–2 Tilde Commands (mailx)




Escapes to a shell command. 


Simulates pressing Ctrl-D to mark end of file. 


Lists a summary of tilde commands. 

~b username

Adds user name(s) to the blind carbon copies (Bcc:) list. 

~c username

Adds user name(s) to the carbon copies (Cc:) list. 


Reads the contents of the dead.letter file into current message.

~f number


Forwards the specified message. Valid only when you send a message while you read mail. 


Prompts for header lines: Subject, To, Cc, and Bcc. 

~m number


Inserts text from the specified message into the current message. Valid only when you send a message while you read mail. 


Prints to the screen the message that you are typing. 


Simulates pressing Ctrl-C twice. If the body of the current message is not empty, the contents are saved to dead.letter.

~r filename

Reads in the text from the specified file. 

~s string

Changes the subject line to string.

~t name

Adds the specified name(s) to the To list. 

~w filename

Writes the current message without the header into the specified file. 


Exits mailx. Similar to ~q except message is not saved in the dead.letter file.