[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 5

sortm Command


Sorts messages.


sortm [ +Folder ] [ Messages ] [ -datefield Field ] [ -noverbose | -verbose ]


The sortm command sorts messages according to their Date: field and renumbers them consecutively beginning with number one. Messages that are in the folder, but not specified to be sorted, are placed after the sorted messages. The sortm command displays a message if it cannot parse a date field.

To specify a field other than the Date: field, specify the -datefield flag. If you specify a folder, it becomes the current folder. The current message remains the current message for the specified folder, even if it moves during the sort.


-datefield Field Specifies the header field to be used in the sort. The Date: field is the default.
+Folder Specifies the folder with messages to be sorted. The default is the current folder.
-help Lists the command syntax, available switches (toggles), and version information.

Note: For Message Handler (MH), the name of this flag must be fully spelled out.
Messages Specifies the messages to be sorted. Use the following references to specify messages:
Number of the message.
A group of messages specified by the user. Recognized values are:
All messages in a folder. This is the default.
cur or . (period)
Current message.
First message in a folder.
Last message in a folder.
Message following the current message.
Message preceding the current message.
-noverbose Prevents display of information during the sort. This flag is the default.
-verbose Displays information during the sort. This information allows you to monitor the steps involved.

Profile Entries

The following entries are found in the UserMhDirectory/.mh_profile file:

Current-Folder: Sets the default current folder.
Path: Specifies the UserMhDirectory.


  1. To sort all the messages in the current folder according to the date, enter:

  2. To sort messages 5 through 10 in the easter folder according to the date, enter:
    sortm +easter 5-10


$HOME/.mh_profile Contains the MH user profile.
/usr/bin/sortm Contains the sortm command.

Related Information

The folder command.

The .mh_alias file format, .mh_profile file format.

Mail Overview in AIX 5L Version 5.2 System User's Guide: Communications and Networks.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]