ali Command

Purpose

Lists mail aliases and their addresses.

Syntax

ali [ -alias File ] [ -list | -nolist ] [ -normalize | -nonormalize] [ -user User | -nouser ] [ Alias ... ]

Description

The ali command lists mail aliases and their addresses. By default, this command searches the /etc/mh/MailAliases file and writes to standard output each alias and its address that is defined in the file. To specify an alternative mail alias file, use the -alias File flag.

If you specify the -user flag, the ali command searches the alias files for the username and writes to standard output the aliases that contain this username.

Flags

Table 1. Flags
Item Description
-alias File Specifies the mail alias file to be searched. The default is the /etc/mh/MailAliases file.
-help Lists the command syntax, available switches (toggles), and version information.
Note: For MH, the name of this flag must be fully spelled out.
-list Displays each address on a separate line.
-nolist Displays addresses on as few lines as possible. This flag is the default.
-nonormalize Prevents conversion of local host nicknames to official hostnames. This flag is the default.
-normalize Converts local host nicknames to their official hostnames.
-nouser Lists the address for an alias. This flag is the default.
-user User Lists the aliases that contain the specified user. When the -user and -nonormalize flags are used together, the result may be a partial list of aliases that contain the specified user.

Examples

  1. To display a list of all aliases and their addresses in the /etc/mh/MailAliases file, enter:
    ali
  2. To list the names and addresses of the mygroup alias, enter:
    ali   mygroup
    A list similar to the following is displayed on your local system:
    mike@mercury   george@helium   vicky@venus

Files

Table 2. Files
Item Description
$HOME/.mh_profile Contains the MH user profile.
/etc/group This directory contains a list of groups.
/etc/passwd This directory contains a list of users.
/etc/mh/MailAliases This directory contains the default mail alias file.
/usr/bin/ali This directory contains the ali command.