neulab/tldr huggingface dataset:
kbs or kb       Backspace. kdch1 or kD     Delete character. kDC or *4       — shifted variant. kel or kE       Clear to end of line. kext or @9      Exit. kich1 or kI     Insert character. kIC or #3       — shifted variant. khome or kh     Home. kHOM or #2      — shifted variant. kend or @7      End. knp or kN       Next page. kpp or kP       Previous page. kcub1 or kl     Left cursor (with more modifiers: see below). kLFT or #4      — shifted variant. kcuf1 or kr     Right cursor (ditto). kRIT or %i      — shifted variant. kcud1 or kd     Down cursor (ditto). kDN             — shifted variant (only terminfo). kcuu1 or ku     Up cursor (ditto). kUP             — shifted variant (only terminfo). kf0 or k0       Function key 0.  Add one for each function key up to kf9 and k9, respectively. kf10 or k;      Function key 10. kf11 or F1      Function key 11.  Add one for each function key up to kf19 and F9, respectively.
Some terminals support key-modifier combination extensions, e.g., ‘Alt+Shift+xy’.  For example, the delete key, kdch1: in its shifted variant, the name is mutated to kDC, then a number is appended for the states ‘Alt’ (kDC3), ‘Shift+Alt’ (kDC4), ‘Control’ (kDC5), ‘Shift+Control’ (kDC6), ‘Alt+Control’ (kDC7), finally ‘Shift+Alt+Control’ (kDC8).  The same for the left cursor key, kcub1: KLFT, KLFT3, KLFT4, KLFT5, KLFT6, KLFT7, KLFT8.
call      [Only new quoting rules] Calls the given macro, which must have been created via define (see there for more), otherwise an ^ERR-NOENT error occurs.  Calling macros recursively will at some time excess the stack size limit, causing a hard program abortion; if recursively calling a macro is the last command of the current macro, consider to use the command xcall, which will first release all resources of the current macro before replacing the current macro with the called one.
call_if   Identical to call if the given macro has been created via define, but does not fail nor warn if the macro does not exist.
cd        Synonym for chdir.
certsave  [Option] Only applicable to S/MIME signed messages.  Takes an optional message list and a filename and saves the certificates contained within the message signatures to the named file in both human-readable and PEM format.  The certificates can later be used to send encrypted messages to the respective message senders by setting smime-encrypt-USER@HOST variables.
charsetalias, uncharsetalias [Only new quoting rules] Manage alias mappings for (conversion of) Character sets.  Alias processing is not performed for INTERNAL VARIABLES, for example charset-8bit, and mappings are ineffective if character set conversion is not available (features does not announce ‘,+iconv,’).  Expansion happens recursively for cases where aliases point to other aliases (built-in loop limit: 8).
The latter command deletes all aliases given as arguments, or all at once when given the asterisk ‘*’.  The former shows the list of all currently defined aliases if used without arguments, or the target of the given single argument; when given two arguments, hyphen-minus ‘-’ being the first, the second is instead expanded recursively.  In all other cases the given arguments are treated as pairs of character sets and their desired target alias name, creating new or updating already existing aliases.
chdir     [Only new quoting rules](ch) Change the working directory to HOME or the given argument.  Synonym for cd.
collapse, uncollapse Only applicable to ‘thread’ed sort mode.  Takes a message list and makes all replies to these messages invisible in header summaries, except for ‘new’ messages and the “dot”.  Also when a message with collapsed replies is displayed, all of these are automatically uncollapsed.  The latter command undoes collapsing.
colour, uncolour [Option][Only new quoting rules] Manage colour mappings of and for a Coloured display.  Without arguments the former shows all currently defined mappings.  Otherwise a colour type is expected (case-insensitively), it must be one of ‘256’ for 256-colour terminals, ‘8’, ‘ansi’ or ‘iso’ for the standard 8-colour ANSI / ISO 6429 colour palette, and ‘1’ or ‘mono’ for monochrome terminals, which only support (some) font attributes.  Without further arguments the list of all currently defined mappings of the given type is shown (here the special ‘all’ or ‘*’ also show all currently defined mappings).
Otherwise the second argument defines the mappable slot, the third argument a (comma-separated list of) colour and font attribute specification(s), and the optionally supported fourth argument can be used to specify a precondition: if conditioned mappings exist they are tested in (creation) order unless a (case-insensitive) match has been found, and the default mapping (if any has been established) will only be chosen as a last resort.  The types of available preconditions depend on the mappable slot, the following of which exist:
Mappings prefixed with ‘mle-’ are used for the [Option]al built- in Mailx-Line-Editor (MLE, see On terminal control and line editor) and do not support preconditions.
mle-position   This mapping is used for the position indicator that is visible when a line cannot be fully displayed on the screen. mle-prompt     Used for the prompt. mle-error      Used for the occasionally appearing error indicator that is joined onto prompt.  [v15 behaviour may differ] Also used for error messages written on standard error .
Mappings prefixed with ‘sum-’ are used in header summaries, and they all understand the preconditions ‘dot’ (the current message) and ‘older’ for elder messages (only honoured in conjunction with datefield-markout-older).
sum-dotmark    This mapping is used for the “dotmark” that can be created with the ‘%>’ or ‘%<’ formats of the variable headline. sum-header     For the complete header summary line except the “dotmark” and the thread structure. sum-thread     For the thread structure which can be created with the ‘%i’ format of the variable headline.
Mappings prefixed with ‘view-’ are used when displaying messages.
view-from_     This mapping is used for so-called ‘From_’ lines, which are MBOX file format specific header lines (also see mbox-rfc4155). view-header    For header lines.  A comma-separated list of headers to which the mapping applies may be given as a precondition; if the [Option]al regular expression support is available then if any of the magic regular expression characters is seen the precondition will be evaluated as (an extended) one. view-msginfo   For the introductional message info line. view-partinfo  For MIME part info lines.
The following (case-insensitive) colour definitions and font attributes are understood, multiple of which can be specified in a comma-separated list:
ft=  a font attribute: ‘bold’, ‘reverse’ or ‘underline’.  It is possible (and often applicable) to specify multiple font attributes for a single mapping.
fg=  foreground colour attribute, in order (numbers 0 - 7) ‘black’, ‘red’, ‘green’, ‘brown’, ‘blue’, ‘magenta’, ‘cyan’ or ‘white’.  To specify a 256-colour mode a decimal number colour specification in the range 0 to 255, inclusive, is supported, and interpreted as follows:
0 - 7      the standard ISO 6429 colours, as above. 8 - 15     high intensity variants of the standard colours. 16 - 231   216 colours in tuples of 6. 232 - 255  grayscale from black to white in 24 steps.
#!/bin/sh - fg() { printf "\033[38;5;${1}m($1)"; } bg() { printf "\033[48;5;${1}m($1)"; } i=0 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done printf "\033[0m\n" i=0 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done printf "\033[0m\n"
bg=  background colour attribute (see fg= for possible values).
The command uncolour will remove for the given colour type (the special type ‘*’ selects all) the given mapping; if the optional precondition argument is given only the exact tuple of mapping and precondition is removed.  The special name ‘*’ will remove all mappings (no precondition allowed), thus ‘uncolour * *’ will remove all established mappings.
commandalias, uncommandalias [Only new quoting rules] Define or list, and remove, respectively, command aliases.  An (command)alias can be used everywhere a normal command can be used, but always takes precedence: any arguments that are given to the command alias are joined onto the alias expansion, and the resulting string forms the command line that is, in effect, executed.  The latter command removes all given aliases, the special name asterisk ‘*’ will remove all existing aliases.  When used without arguments the former shows a list of all currently known aliases, with one argument only the expansion of the given one.
With two or more arguments a command alias is defined or updated: the first argument is the name under which the remaining command line should be accessible, the content of which can be just about anything.  An alias may itself expand to another alias, but to avoid expansion loops further expansion will be prevented if an alias refers to itself or if an expansion depth limit is reached. Explicit expansion prevention is available via reverse solidus \, one of the Command modifiers.
? commandalias xx mail: `commandalias': no such alias: xx ? commandalias xx echo hello, ? commandalias xx commandalias xx 'echo hello,' ? xx hello, ? xx world hello, world
Copy      (C) Similar to copy, but copy the messages to a file named after the local part of the sender of the first message instead of taking a filename argument; outfolder is inspected to decide on the actual storage location.
copy      (c) Copy messages to the named file and do not mark them as being saved; otherwise identical to save.
csop      [Only new quoting rules] A multiplexer command which provides C- style string operations on 8-bit bytes without a notion of locale settings and character sets, effectively assuming ASCII data. For numeric and other operations refer to vexpr.  vput, one of the Command modifiers, is supported.  The error result is ‘-1’ for usage errors and numeric results, the empty string otherwise; missing data errors, as for unsuccessful searches, result in the ! error number being set to ^ERR-NODATA.  Where the question mark ‘?’ modifier suffix is supported, a case-insensitive (ASCII mapping) operation mode is supported; the keyword ‘case’ is optional so that ‘find?’ and ‘find?case’ are identical.
length    Queries the length of the given argument.
hash, hash32 Calculates a hash value of the given argument.  The latter will return a 32-bit result regardless of host environment.  ‘?’ modifier suffix is supported.  These use Chris Torek's hash algorithm, the resulting hash value is bit mixed as shown by Bret Mulvey.
find      Search for the second in the first argument.  Shows the resulting 0-based offset shall it have been found.  ‘?’ modifier suffix is supported.
substring Creates a substring of its first argument.  The optional second argument is the 0-based starting offset, a negative one counts from the end; the optional third argument specifies the length of the desired result, a negative length leaves off the given number of bytes at the end of the original string; by default the entire string is used.  This operation tries to work around faulty arguments (set verbose for error logs), but reports them via the error number ! as ^ERR-OVERFLOW.
trim      Trim away whitespace characters from both ends of the argument.
trim-front Trim away whitespace characters from the begin of the argument.
trim-end  Trim away whitespace characters from the end of the argument.
cwd       Show the name of the current working directory, as reported by getcwd(3).  Supports vput (see Command modifiers).  The return status is tracked via ?.
Decrypt   [Option] For unencrypted messages this command is identical to Copy; Encrypted messages are first decrypted, if possible, and then copied.
decrypt   [Option] For unencrypted messages this command is identical to copy; Encrypted messages are first decrypted, if possible, and then copied.
define, undefine The latter command deletes the given macro, the special name ‘*’ will discard all existing macros.  Deletion of (a) macro(s) can be performed from within running (a) macro(s), including self- deletion.  Without arguments the former command prints the current list of macros, including their content, otherwise it defines a macro, replacing an existing one of the same name as applicable.
A defined macro can be invoked explicitly by using the call, call_if and xcall commands, or implicitly if a macro hook is triggered, for example a folder-hook.  Execution of a macro body can be stopped from within by calling return.
Temporary macro block-scope variables can be created or deleted with the local command modifier in conjunction with the commands set and unset, respectively.  To enforce unrolling of changes made to (global) INTERNAL VARIABLES the command localopts can be used instead; its covered scope depends on how (i.e., “as what”: normal macro, folder hook, hook, account switch) the macro is invoked.
Inside a called macro, the given positional parameters are implicitly local to the macro's scope, and may be accessed via the variables *, @, # and 1 and any other positive unsigned decimal number less than or equal to #.  Positional parameters can be shifted, or become completely replaced, removed etc. via vpospar.  A helpful command for numeric computation and string evaluations is vexpr, csop offers C-style byte string operations.
define name { command1 command2 ... commandN }
define exmac { echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@} return 1000 0 } call exmac Hello macro exmac! echo ${?}/${!}/${^ERRNAME}
delete, undelete (d, u) Marks the given message list as being or not being ‘deleted’, respectively; if no argument has been specified then the usual search for a visible message is performed, as documented for Message list arguments, showing only the next input prompt if the search fails.  Deleted messages will neither be saved in the secondary mailbox MBOX nor will they be available for most other commands.  If the autoprint variable is set, the new “dot” or the last message restored, respectively, is automatically typed; also see dp, dt.
digmsg    [Only new quoting rules] Digging (information out of) messages is possible through digmsg objects, which can be created for the given message number; in Compose mode the hyphen-minus ‘-’ will instead open the message that is being composed.  If a hyphen- minus is given as the optional third argument then output will be generated on the standard output channel instead of being subject to consumption by the readsh (here better than read or readall) command.
The objects may be removed again by giving the same identifier used for creation; this step could be omitted: objects will be automatically closed when the active folder (mailbox) or the compose mode is left, respectively.  In all other use cases the second argument is an object identifier, and the third and all following arguments are interpreted as via ~^ (see COMMAND ESCAPES):
? vput = msgno; digmsg create $msgno ? digmsg $msgno header list;   readall x;   echon $x 210 Subject From To Message-ID References In-Reply-To ? digmsg $msgno header show Subject;readall x;echon $x 212 Subject 'Hello, world'
? digmsg remove $msgno
discard   (di) Identical to ignore.  Superseded by the multiplexer headerpick.
dp, dt    Delete the given messages and automatically type the new “dot” if one exists, regardless of the setting of autoprint.
dotmove   Move the “dot” up or down by one message when given ‘+’ or ‘-’ argument, respectively.
draft, undraft Take message lists and mark each given message as being draft, or not being draft, respectively, as documented in the section Message states.
echo      [Only new quoting rules](ec) Print the given strings, equivalent to the shell utility echo(1), that is, Shell-style argument quoting expansion is performed and, different to the otherwise identical echon, a trailing newline is echoed.  vput as documented in Command modifiers is supported, and the error number ! is managed: if data is stored in a variable then the return value reflects the length of the result string in case of success and is ‘-1’ on error.
Remarks: this command traditionally (in BSD Mail) also performed Filename transformations, which is standard incompatible and hard to handle because quoting transformation patterns is not possible; the subcommand file-expand of vexpr can be used to expand filenames.
echoerr   [Only new quoting rules] Identical to echo, but the message is written to standard error, and prefixed by log-prefix.  Also see echoerrn.  In interactive sessions the [Option]al message ring queue for errors will be used instead, if available and vput was not used.
echon     [Only new quoting rules] Identical to echo, but does not write or store a trailing newline.
echoerrn  [Only new quoting rules] Identical to echoerr, but does not write or store a trailing newline.
edit      (e) Point the text EDITOR at each message from the given list in turn.  Modified contents are discarded unless the writebackedited variable is set, and are not used unless the mailbox can be written to and the editor returns a successful exit status. visual can be used instead for a more display oriented editor.
elif      Part of the if (see there for more), elif, else, endif conditional — if the condition of a preceding if was false, check the following condition and execute the following block if it evaluates true.
else      (el) Part of the if (see there for more), elif, else, endif conditional — if none of the conditions of the preceding if and elif commands was true, the else block is executed.
endif     (en) Marks the end of an if (see there for more), elif, else, endif conditional execution block.
environ   [Only new quoting rules] There is a strict separation in between INTERNAL VARIABLES and the program ENVIRONMENT, which is inherited by child processes.  Some variables of the latter are however vivid for program operation, their purpose is known, therefore they have been integrated transparently into handling of the former, as accessible via set and unset.  To integrate any other environment variable, and/or to export internal variables into the process environment where they normally are not, a link needs to become established with this command, for example
environ link PERL5LIB TZ
Afterwards changing such variables with set will cause automatic updates of the environment, too.  Sufficient system support provided (it was in BSD as early as 1987, and is standardized since Y2K) removing such variables with unset will remove them also from the environment, but in any way the knowledge they ever have been linked will be lost.  This implies that localopts may cause loss of such links.
The subcommand unlink removes an existing link without otherwise touching variables, the set and unset subcommands are identical to set and unset, but additionally update the program environment accordingly; removing a variable breaks any freely established link.
errors    [Option] As console user interfaces at times scroll error messages by too fast and/or out of scope, data can additionally be sent to an error queue manageable by this command: show or no argument will display and clear the queue, clear will only clear it.  As the queue becomes filled with errors-limit entries the eldest entries are being dropped.  There are also the variables ^ERRQUEUE-COUNT and ^ERRQUEUE-EXISTS.
eval      [Only new quoting rules] Construct a command by concatenating the arguments, separated with a single space character, and then evaluate the result.  This command passes through the exit status ? and error number ! of the evaluated command; also see call.
define xxx { echo "xxx arg <$1>" shift if $# -gt 0 \xcall xxx "$@" endif } define yyy { eval "$@ ' ball" } call yyy '\call xxx' "b\$'\t'u ' " call xxx arg <b      u> call xxx arg <  > call xxx arg <ball>
exit      (ex or x) Exit from Mail without changing the active mailbox and skip any saving of messages in the secondary mailbox MBOX, as well as a possibly tracked line editor history-file.  A possibly set on-account-cleanup will be invoked, however.  The optional status number argument will be passed through to exit(3).  [v15 behaviour may differ] For now it can happen that the given status will be overwritten, later this will only occur if a later error needs to be reported onto an otherwise success indicating status.
File      (Fi) Like folder, but open the mailbox read-only.
file      (fi) See folder.
filetype, unfiletype [Only new quoting rules] Define, list, and remove, respectively, file handler hooks, which provide (shell) commands that enable Mail to load and save MBOX files from and to files with the registered file extensions, as shown and described for folder. The extensions are used case-insensitively, yet the auto- completion feature of for example folder will only work case- sensitively.  An intermediate temporary file will be used to store the expanded data.  The latter command will remove hooks for all given extensions, asterisk ‘*’ will remove all existing handlers.
When used without arguments the former shows a list of all currently defined file hooks, with one argument the expansion of the given alias.  Otherwise three arguments are expected, the first specifying the file extension for which the hook is meant, and the second and third defining the load- and save commands to deal with the file type, respectively, both of which must read from standard input and write to standard output.  Changing hooks will not affect already opened mailboxes ([v15 behaviour may differ] except below).  [v15 behaviour may differ] For now too much work is done, and files are oftened read in twice where once would be sufficient: this can cause problems if a filetype is changed while such a file is opened; this was already so with the built-in support of .gz etc. in Heirloom, and will vanish in v15. [v15 behaviour may differ] For now all handler strings are passed to the SHELL for evaluation purposes; in the future a ‘!’ prefix to load and save commands may mean to bypass this shell instance: placing a leading space will avoid any possible misinterpretations.
? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \ gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \ zst 'zstd -dc' 'zstd -19 -zc' \ zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e' ? set record=+sent.zst.pgp
flag, unflag Take message lists and mark the messages as being flagged, or not being flagged, respectively, for urgent/special attention.  See the section Message states.
Folder    (Fold) Like folder, but open the mailbox read-only.
folder    (fold) Open a new, or show status information of the current mailbox.  If an argument is given, changes (such as deletions) will be written out, a new mailbox will be opened, the internal variables mailbox-resolved and mailbox-display will be updated, a set according folder-hook is executed, and optionally a summary of headers is displayed if the variable header is set.
Filename transformations will be applied to the name argument, and ‘protocol://’ prefixes are, i.e., URL (see On URL syntax and credential lookup) syntax is understood, as in ‘mbox:///tmp/somefolder’.  If a protocol prefix is used the mailbox type is fixated, otherwise opening none-existing folders uses the protocol defined in newfolders.
For the protocols mbox and file (MBOX database), as well as eml (electronic mail message [v15 behaviour may differ] read-only) the list of all registered filetypes is traversed to check whether hooks shall be used to load (and save) data from (and to) the given name.  Changing hooks will not affect already opened mailboxes.  For example, the following creates hooks for the gzip(1) compression tool and a combined compressed and encrypted format:
? filetype \ gzip 'gzip -dc' 'gzip -c' \ zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
For historic reasons filetypes provide limited (case-sensitive) auto-completion capabilities.  For example ‘mbox.gz’ will be found for ‘? file mbox’, provided that corresponding handlers are installed.  It will neither find ‘mbox.GZ’ nor ‘mbox.Gz’ however, but an explicit ‘? file mbox.GZ’ will find and use the handler for ‘gz’.  [v15 behaviour may differ] The latter mode can only be used for MBOX files.
EML files consist of only one mail message, [v15 behaviour may differ] and can only be opened read-only.  When reading MBOX files tolerant POSIX rules are used by default.  Invalid message boundaries that can be found quite often in historic MBOX files will be complained about (even more with debug): in this case the method described for mbox-rfc4155 can be used to create a valid MBOX database from the invalid input.
MBOX databases and EML files will always be protected via file- region locks (fcntl(2)) during file operations to protect against concurrent modifications.  [Option] An MBOX inbox (MAIL) or primary system mailbox will also be protected by so-called dotlock files, the traditional way of mail spool file locking: for any file ‘x’ a lock file ‘x.lock’ will be created during the synchronization, in the same directory and with the same user and group identities as the file of interest — as necessary created by an external privileged dotlock helper.  dotlock-disable disables dotlock files.  Also see FAQ: Howto handle stale dotlock files.
[Option] If no protocol has been fixated, and name refers to a directory with the subdirectories ‘tmp’, ‘new’ and ‘cur’, then it is treated as a folder in “Maildir” format.  The maildir format stores each message in its own file, and has been designed so that file locking is not necessary when reading or writing files.
[Option]ally URLs can be used to access network resources, securely via Encrypted network communication, if so supported. Network communication socket timeouts are configurable via socket-connect-timeout.  All network traffic may be proxied over a SOCKS server via socks-proxy.
[v15-compat] protocol://[user[:password]@]host[:port][/path] [no v15-compat] protocol://[user@]host[:port][/path]
[Option]ally supported network protocols are pop3 (POP3) and pop3s (POP3 with TLS encrypted transport), imap and imaps.  The [/path] part is valid only for IMAP; there it defaults to INBOX. Network URLs require a special encoding as documented in the section On URL syntax and credential lookup.
folders   Lists the names of all folders below the given argument or folder.  For file-based protocols LISTER will be used for display purposes.
Followup, followup (Compose mode)(F,fo) Similar to Reply, and reply, respectively, but save the message in a file named after the local part of the (first) recipient's address, possibly overwriting record, and honouring outfolder.  Also see Copy and Save.
Forward   (Compose mode) Similar to forward, but saves the message in a file named after the local part of the recipient's address (instead of in record).
forward   (Compose mode) Take a message list and the address of a recipient, subject to fullnames, to whom the messages are sent. The text of the original message is included in the new one, enclosed by the values of forward-inject-head and forward-inject-tail.  content-description-forwarded-message is inspected.  The list of included headers can be filtered with the ‘forward’ slot of the white- and blacklisting command headerpick. Only the first part of a multipart message is included but for forward-as-attachment.
This may generate the errors ^ERR-DESTADDRREQ if no receiver has been specified, or was rejected by expandaddr policy, ^ERR-IO if an I/O error occurs, ^ERR-NOTSUP if a necessary character set conversion fails, and ^ERR-INVAL for other errors.  It can also fail with errors of Specifying messages.  Any error stops processing of further messages.
from      (f) Takes a list of message specifications and displays a summary of their message headers, exactly as via headers, making the first message of the result the new “dot” (the last message if showlast is set).  An alias of this command is search.  Also see Specifying messages.
Fwd       [Obsolete] Alias for Forward.
fwd       [Obsolete] Alias for forward.
fwdignore [Obsolete] Superseded by the multiplexer headerpick.
fwdretain [Obsolete] Superseded by the multiplexer headerpick.
ghost, unghost [Obsolete] Replaced by commandalias, uncommandalias.
headerpick, unheaderpick [Only new quoting rules] Multiplexer command to manage white- and blacklisting selections of header fields for a variety of applications.  Without arguments the set of contexts that have settings is displayed.  When given arguments, the first argument is the context to which the command applies, one of (case- insensitive) ‘type’ for display purposes (for example type), ‘save’ for selecting which headers shall be stored persistently when save, copy, move or even decrypting messages (note that MIME related etc. header fields should not be ignored in order to not destroy usability of the message in this case), ‘forward’ for stripping down messages when forwarding message (has no effect if forward-as-attachment is set), and ‘top’ for defining user- defined set of fields for the command top.
The current settings of the given context are displayed if it is the only argument.  A second argument denotes the type of restriction that is to be chosen, it may be (a case-insensitive prefix of) ‘retain’ or ‘ignore’ for white- and blacklisting purposes, respectively.  Establishing a whitelist suppresses inspection of the corresponding blacklist.
If no further argument is given the current settings of the given type will be displayed, otherwise the remaining arguments specify header fields, which [Option]ally may be given as regular expressions, to be added to the given type.  The special wildcard field (asterisk, ‘*’) will establish a (fast) shorthand setting which covers all fields.
The latter command always takes three or more arguments and can be used to remove selections, i.e., from the given context, the given type of list, all the given headers will be removed, the special argument ‘*’ will remove all headers.
headers   (h) Show the current group of headers, the size of which depends on the variable screen in interactive mode, and the format of which can be defined with headline.  If a message-specification is given the group of headers containing the first message therein is shown and the message at the top of the screen becomes the new “dot”; the last message is targeted if showlast is set.
help      (hel) A synonym for ?.
history   [Option] Without arguments or when given show all history entries are shown (this mode also supports a more verbose output).  load will replace the list of entries with the content of history-file, and save will dump all entries to said file, replacing former content, and clear will delete all entries.  The argument can also be a signed decimal NUMBER, which will select and evaluate the respective history entry, and move it to the top of the history; a negative number is used as an offset to the current command so that ‘-1’ will select the last command, the history top, whereas delete will delete all given entries (:NUMBER:).  Also see On terminal control and line editor.
hold      (ho, also preserve) Takes a message list and marks each message therein to be saved in the user's system inbox instead of in the secondary mailbox MBOX.  Does not override the delete command. Mail deviates from the POSIX standard with this command, because a next command issued after hold will display the following message, not the current one.
if        (i) Part of the if, elif, else, endif conditional execution construct — if the given condition is true then the encapsulated block is executed.  The POSIX standard only supports the (case- insensitive) conditions ‘r’eceive and ‘s’end, the remaining are non-portable extensions.  [v15 behaviour may differ] In conjunction with the wysh command prefix(es) Shell-style argument quoting and more test operators are available.
if receive commands ... else commands ... endif
Further (case-insensitive) one-argument conditions are ‘t’erminal which evaluates to true in interactive terminal sessions (running with standard input or standard output attached to a terminal, and none of the “quickrun” command line options -e, -H and -L have been used), as well as any boolean value (see INTERNAL VARIABLES for textual boolean representations) to mark an enwrapped block as “never execute” or “always execute”. (Remarks: condition syntax errors skip all branches until endif.)
[no v15-compat] and without wysh: It is possible to check INTERNAL VARIABLES as well as ENVIRONMENT variables for existence or compare their expansion against a user given value or another variable by using the ‘$’ (“variable next”) conditional trigger character; a variable on the right hand side may be signalled using the same mechanism.  Variable names may be enclosed in a pair of matching braces.  When this mode has been triggered, several operators are available ([v15-compat] and wysh: they are always available, and there is no trigger: variables will have been expanded by the shell-compatible parser before the if etc. command sees them).
[v15-compat] Two argument conditions.  Variables can be tested for existence and expansion: ‘-N’ will test whether the given variable exists, so that ‘-N editalong’ will evaluate to true when editalong is set, whereas ‘-Z editalong’ will if it is not. ‘-n "$editalong"’ will be true if the variable is set and expands to a non-empty string, ‘-z $'\$editalong'’ only if the expansion is empty, whether the variable exists or not.  The remaining conditions take three arguments.
Integer operators treat the arguments on the left and right hand side of the operator as integral numbers and compare them arithmetically.  It is an error if any of the operands is not a valid integer, an empty argument (which implies it had been quoted) is treated as if it were 0.  Via the question mark ‘?’ modifier suffix a saturated operation mode is available where numbers will linger at the minimum or maximum possible value, instead of overflowing (or trapping), the keyword ‘saturated’ is optional, ‘==?’, ‘==?satu’ and ‘==?saturated’ are therefore identical.  Available operators are ‘-lt’ (less than), ‘-le’ (less than or equal to), ‘-eq’ (equal), ‘-ne’ (not equal), ‘-ge’ (greater than or equal to), and ‘-gt’ (greater than).
String and regular expression data operators compare the left and right hand side according to their textual content.  Unset variables are treated as the empty string.  Via the question mark ‘?’ modifier suffix a case-insensitive operation mode is available, the keyword ‘case’ is optional, ‘==?’ and ‘==?case’ are identical.
Available string operators are ‘<’ (less than), ‘<=’ (less than or equal to), ‘==’ (equal), ‘!=’ (not equal), ‘>=’ (greater than or equal to), ‘>’ (greater than), ‘=%’ (is substring of) and ‘!%’ (is not substring of).  By default these operators work on bytes and (therefore) do not take into account character set specifics. If the case-insensitivity modifier has been used, case is ignored according to the rules of the US-ASCII encoding, i.e., bytes are still compared.
When the [Option]al regular expression support is available, the additional string operators ‘=~’ and ‘!~’ can be used.  They treat the right hand side as an extended regular expression that is matched according to the active locale (see Character sets), i.e., character sets should be honoured correctly.
Conditions can be joined via AND-OR lists (where the AND operator is ‘&&’ and the OR operator is ‘||’), which have equal precedence and will be evaluated with left associativity, thus using the same syntax that is known for the sh(1).  It is also possible to form groups of conditions and lists by enclosing them in pairs of brackets ‘[ ... ]’, which may be interlocked within each other, and also be joined via AND-OR lists.
The results of individual conditions and entire groups may be modified via unary operators: the unary operator ‘!’ will reverse the result.
wysh set v15-compat=yes # with value: automatic "wysh"! if -N debug;echo *debug* set;else;echo not;endif if "$ttycharset" == UTF-8 || "$ttycharset" ==?cas UTF8 echo ttycharset is UTF-8, the former case-sensitive! endif set t1=one t2=one if [ "${t1}" == "${t2}" ] echo These two variables are equal endif if "$features" =% ,+regex, && "$TERM" =~?case ^xterm.* echo ..in an X terminal endif if [ [ true ] && [ [ "${debug}" != '' ] || \ [ "$verbose" != '' ] ] ] echo Noisy, noisy endif if true && [ -n "$debug" || -n "${verbose}" ] echo Left associativity, as is known from the shell endif
ignore    (ig) Identical to discard.  Superseded by the multiplexer headerpick.
list      Shows the names of all available commands, in command lookup order.  [Option] In conjunction with a set variable verbose additional information will be provided for each command: the argument type will be indicated, the documentation string will be shown, and the set of command flags will show up:
‘`local'’    command supports the command modifier local. ‘`vput'’     command supports the command modifier vput. ‘*!*’        the error number is tracked in !. ‘needs-box’  whether the command needs an active mailbox, a folder. ‘ok:’        indicators whether command is ... ‘batch/interactive’ usable in interactive or batch mode (-#). ‘send-mode’   usable in send mode. ‘subprocess’  allowed to be used when running in a subprocess instance, for example from within a macro that is called via on-compose-splice. ‘not ok:’    indicators whether command is not ... ‘compose mode’  available in Compose mode. ‘startup’       available during program startup, like in Resource files. ‘gabby’      The command produces history-gabby history entries.
localopts Enforce change localization of environ (linked) ENVIRONMENT as well as (global) INTERNAL VARIABLES, meaning that their state will be reverted to the former one once the “covered scope” is left.  Just like the command modifier local, which provides block-scope localization for some commands (instead), it can only be used inside of macro definition blocks introduced by account or define.  The covered scope of an account is left once a different account is activated, and some macros, notably folder-hooks, use their own specific notion of covered scope, here it will be extended until the folder is left again.
This setting stacks up: i.e., if ‘macro1’ enables change localization and calls ‘macro2’, which explicitly resets localization, then any value changes within ‘macro2’ will still be reverted when the scope of ‘macro1’ is left.  (Caveats: if in this example ‘macro2’ changes to a different account which sets some variables that are already covered by localizations, their scope will be extended, and in fact leaving the account will (thus) restore settings in (likely) global scope which actually were defined in a local, macro private context!)
This command takes one or two arguments, the optional first one specifies an attribute that may be one of scope, which refers to the current scope and is thus the default, call, which causes any macro that is being called to be started with localization enabled by default, as well as call-fixate, which (if enabled) disallows any called macro to turn off localization: like this it can be ensured that once the current scope regains control, any changes made in deeper levels have been reverted.  The latter two are mutually exclusive, and neither affects xcall.  The (second) argument is interpreted as a boolean (string, see INTERNAL VARIABLES) and states whether the given attribute shall be turned on or off.
define temporary_settings { set possibly_global_option1 localopts on set localized_option1 set localized_option2 localopts scope off set possibly_global_option2 }
Lfollowup, Lreply (Compose mode) Reply to messages that come in via known (mlist) or subscribed (mlsubscribe) mailing lists, or pretend to do so (see Mailing lists): on top of the usual followup and reply, respectively, functionality this will actively resort and even remove message recipients in order to generate a message that is supposed to be sent to a mailing list.  For example it will also implicitly generate a ‘Mail-Followup-To:’ header if that seems useful, regardless of the setting of the variable followup-to. For more documentation please refer to On sending mail, and non- interactive mode.
This may generate the errors ^ERR-DESTADDRREQ if no receiver has been specified, ^ERR-PERM if some addressees where rejected by expandaddr, ^ERR-IO if an I/O error occurs, ^ERR-NOTSUP if a necessary character set conversion fails, and ^ERR-INVAL for other errors.  It can also fail with errors of Specifying messages.  Occurrence of some of the errors depend on the value of expandaddr.  Any error stops processing of further messages.
Mail      (Compose mode) Similar to mail, but saves the message in a file named after the local part of the first recipient's address (instead of in record).
mail      (Compose mode)(m) Takes a (list of) recipient address(es) as (an) argument(s), or asks on standard input if none were given; then collects the remaining mail content and sends it out.  Unless the internal variable fullnames is set recipient addresses will be stripped from comments, names etc.  For more documentation please refer to On sending mail, and non-interactive mode.
This may generate the errors ^ERR-DESTADDRREQ if no receiver has been specified, ^ERR-PERM if some addressees where rejected by expandaddr, ^ERR-NOTSUP if multiple messages have been specified, ^ERR-IO if an I/O error occurs, ^ERR-NOTSUP if a necessary character set conversion fails, and ^ERR-INVAL for other errors. It can also fail with errors of Specifying messages.  Occurrence of some of the errors depend on the value of expandaddr.
mailcap   [Option] When used without arguments or if show has been given the content of The Mailcap files cache is shown, (re-)initializing it first (as necessary.  If the argument is load then the cache will only be (re-)initialized, and clear will remove its contents.  Note that Mail will try to load the files only once, use ‘mailcap clear’ to unlock further attempts. Loading and parsing can be made more verbose.
mbox      (mb) The given message list is to be sent to the secondary mailbox MBOX when Mail is quit; this is the default action unless the variable hold is set.  [v15 behaviour may differ] This command can only be used in a primary system mailbox.
mimetype, unmimetype [Only new quoting rules] Without arguments the content of the MIME type cache will displayed; a more verbose listing will be produced if either of debug or verbose are set.  When given arguments they will be joined, interpreted as shown in The mime.types files (also see HTML mail and MIME attachments), and the resulting entry will be added (prepended) to the cache.  In any event MIME type sources are loaded first as necessary – mimetypes-load-control can be used to fine-tune which sources are actually loaded.
The latter command deletes all specifications of the given MIME type, thus ‘? unmimetype text/plain’ will remove all registered specifications for the MIME type ‘text/plain’.  The special name ‘*’ will discard all existing MIME types, just as will ‘reset’, but which also reenables cache initialization via mimetypes-load-control.
mimeview  [v15 behaviour may differ] Only available in interactive mode, this command allows execution of external MIME type handlers which do not integrate into the normal type output (see HTML mail and MIME attachments).  ([v15 behaviour may differ] No syntax to directly address parts, this restriction may vanish.)  The user will be asked for each non-text part of the given message in turn whether the registered handler shall be used to display the part.
mlist, unmlist [Only new quoting rules] Manage the list of known Mailing lists; subscriptions are controlled via mlsubscribe.  The latter command deletes all given arguments, or all at once when given the asterisk ‘*’.  The former shows the list of all currently known lists if used without arguments, otherwise the given arguments will become known.  [Option] In the latter case, arguments which contain any of the magic regular expression characters will be interpreted as one, possibly matching many addresses; these will be sequentially matched via linked lists instead of being looked up in a dictionary.
mlsubscribe, unmlsubscribe Building upon the command pair mlist, unmlist, but only managing the subscription attribute of mailing lists.  (The former will also create not yet existing mailing lists.)
Move      Similar to move, but move the messages to a file named after the local part of the sender of the first message instead of taking a filename argument; outfolder is inspected to decide on the actual storage location.
move      Acts like copy but marks the messages for deletion if they were transferred successfully.
More      Like more, but also displays header fields which would not pass the headerpick selection, and all MIME parts.  Identical to Page.
more      Invokes the PAGER on the given messages, even in non-interactive mode and as long as the standard output is a terminal.  Identical to page.
mtaaliases [Option] When used without arguments or if show has been given the content of the mta-aliases cache is shown, (re-)initializing it first (as necessary).  If the argument is load then the cache will only be (re-)initialized, and clear will remove its contents.
netrc     [Option] When used without arguments, or when the argument was show the content of the ~/.netrc cache is shown, initializing it as necessary.  If the argument is load then the cache will be (re)loaded, whereas clear removes it.  Loading and parsing can be made more verbose.  lookup will query the cache for the URL given as the second argument (‘[USER@]HOST’).  See netrc-lookup, netrc-pipe and the section On URL syntax and credential lookup; the section The .netrc file documents the file format in detail.
newmail   Checks for new mail in the current folder without committing any changes before.  If new mail is present, a message is shown.  If the header variable is set, the headers of each new message are also shown.  This command is not available for all mailbox types.
next      (n) (like ‘+’ or “ENTER”) Goes to the next message in sequence and types it.  With an argument list, types the next matching message.
New       Same as Unread.
new       Same as unread.
noop      If the current folder is accessed via a network connection, a “NOOP” command is sent, otherwise no operation is performed.
Page      Like page, but also displays header fields which would not pass the headerpick selection, and all MIME parts.  Identical to More.
page      Invokes the PAGER on the given messages, even in non-interactive mode and as long as the standard output is a terminal.  Identical to more.
Pipe      Like pipe but also pipes header fields which would not pass the headerpick selection, and all parts of MIME ‘multipart/alternative’ messages.
pipe      (pi) Takes an optional message list and shell command (that defaults to cmd), and pipes the messages through the command.  If the page variable is set, every message is followed by a formfeed character.
preserve  (pre) A synonym for hold.
Print     (P) Alias for Type.
print     (p) Research UNIX equivalent of type.
quit      (q) Terminates the session, saving all undeleted, unsaved messages in the current secondary mailbox MBOX, preserving all messages marked with hold or preserve or never referenced in the system inbox, and removing all other messages from the primary system mailbox.  If new mail has arrived during the session, the message “You have new mail” will be shown.  If given while editing a mailbox file with the command line option -f, then the edit file is rewritten.  A return to the shell is effected, unless the rewrite of edit file fails, in which case the user can escape with the exit command.  The optional status number argument will be passed through to exit(3).  [v15 behaviour may differ] For now it can happen that the given status will be overwritten, later this will only occur if a later error needs to be reported onto an otherwise success indicating status.