Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Why doesn't the list command work in mail?

When I try l or list, it doesn't work. It instead gives me a list of the valid commands, including list.

Commands are:
next, alias, print, type, Type, Print, visual, top, touch, preserve, 
delete, dp, dt, undelete, unset, mail, mbox, more, page, More, Page, 
unread, U, !, copy, chdir, cd, save, source, set, shell, version, 
group, write, from, file, folder, folders, ?, z, headers, help, =, 
Reply, Respond, reply, respond, edit, echo, quit, list, xit, exit, 
size, hold, if, else, endif, alternates, ignore, discard, retain, 
saveignore, savediscard, saveretain, core, #, clobber


 # cat /etc/redhat-release 
 CentOS release 5.5 (Final)

# mail --version
mail: invalid option -- -
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
            [-- sendmail-options ...]
       mail [-iInNv] -f [name]
       mail [-iInNv] [-u user]

# $ rpm -qf $(which mail)

Granted, I've NEVER been able to get this to work regardless of which distro. But I'll be happy to know how to do it on just one.

share|improve this question
There are several mail commands. Which one do you have? Try mail --version, or the first line that appears when you start mail, or ask your distribution (e.g. dpkg -S $(which mail) or rpm -qf $(which mail). – Gilles Nov 12 '11 at 19:48
der.. no version info. sorry – frogstarr78 Nov 12 '11 at 23:58
up vote 3 down vote accepted

According to the mail(1) man page, list is working just fine:

list    (l) List the valid mail commands.

What you are looking for is probably h or z

        (h) Lists the current windowful of headers.  To view the 
        next or previous group  of headers, see the z command.

z       mail presents message headers in windowfuls as described under 
        the headers command.  You can move mail's attention forward to
        the next window with the z command.  Also, you can move to the
        previous window by using z-.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.