{
    "mode": "man",
    "parameter": "PICK",
    "section": "1mh",
    "url": "https://www.chedong.com/phpMan.php/man/PICK/1mh/json",
    "generated": "2026-11-08T04:55:55Z",
    "synopsis": "pick [-help] [-version] [+folder] [msgs] [-reverse ...]  [-and ...]  [-or ...]  [-not ...]\n[-lbrace ...  -rbrace] [--component pattern] [-cc pattern] [-date pattern] [-from pat‐\ntern] [-search pattern] [-subject pattern] [-to pattern] [-after date] [-before date]\n[-datefield field] [-sequence name ...]  [-nosequence] [-public | -nopublic] [-zero |\n-nozero] [-list | -nolist] [-debug]\ntypical usage:\nscan `pick -from jones`\npick -to holloway -sequence select\nshow `pick -before friday`",
    "sections": {
        "NAME": {
            "content": "pick - search nmh messages\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pick [-help] [-version] [+folder] [msgs] [-reverse ...]  [-and ...]  [-or ...]  [-not ...]\n[-lbrace ...  -rbrace] [--component pattern] [-cc pattern] [-date pattern] [-from pat‐\ntern] [-search pattern] [-subject pattern] [-to pattern] [-after date] [-before date]\n[-datefield field] [-sequence name ...]  [-nosequence] [-public | -nopublic] [-zero |\n-nozero] [-list | -nolist] [-debug]\n\ntypical usage:\n\nscan `pick -from jones`\npick -to holloway -sequence select\nshow `pick -before friday`\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "pick  searches  within a folder for messages with the specified contents, and then identifies\nthose messages.  Two types of search primitives are available: pattern matching and date con‐\nstraint operations.\n\nA modified grep(1) is used to perform the matching,  so  the  full  regular  expression  (see\ned(1))  facility  is  available  within pattern.  With -search, pattern is used directly, and\nwith the others, the grep pattern constructed is:\n\n`component[ \\t]*:.*pattern'\n\nThis means that the pattern specified for a -search will be found everywhere in the  message,\nincluding  the  header and the body, while the other pattern matching requests are limited to\nthe single specified component.  The expression\n\n`--component pattern'\n\nis a shorthand for specifying\n\n`-search “component[ \\t]*:.*pattern” '\n\nIt is used to pick a component which is not one of “To:”, “cc:”, “Date:”, “From:”,  or  “Sub‐\nject:”.  An example is “pick --reply-to pooh”.\n\nPattern  matching  is  performed on a per-line basis.  Within the header of the message, each\ncomponent is treated as one long line, but in the body, each line  is  separate.   Lower-case\nletters in the search pattern will match either lower or upper case in the message, while up‐\nper case will match only upper case.\n\nNote  that  since  the  -date switch is a pattern matching operation (as described above), to\nfind messages sent on a certain date the pattern string must match the text  of  the  “Date:”\nfield of the message.\n\nIndependent of any pattern matching operations requested, the switches -after date or -before\ndate may also be used to introduce date/time constraints on all of the messages.  By default,\nthe  “Date:”  field is consulted, but if another date-yielding field (such as “BB-Posted:” or\n“Delivery-Date:”) should be used, the -datefield field switch may be used.\n\nWith -before and -after, pick will actually parse the date fields in  each  of  the  messages\nspecified  in  `msgs'  and compare them to the date/time specified.  If -after is given, then\nonly those messages whose “Date:” field value is chronologically  after  the  date  specified\nwill be considered.  The -before switch specifies the complementary action.\n\nBoth  the  -after  and -before switches take legal RFC 822-style date specifications as argu‐\nments.  pick will default certain missing fields so that the entire date need not  be  speci‐\nfied.  These fields are (in order of defaulting): timezone, time and timezone, date, date and\ntimezone.  All defaults are taken from the current date, time, and timezone.\n\nIn  addition  to  RFC  822-style  dates, pick will also recognize any of the days of the week\n(“sunday”, “monday”, and so on), and the special dates “today”, “yesterday” (24  hours  ago),\nand “tomorrow” (24 hours from now).  All days of the week are judged to refer to a day in the\npast  (e.g.,  telling  pick  “saturday” on a “tuesday” means “last saturday” not “this satur‐\nday”).\n\nFinally, in addition to these special specifications, pick will also honor a specification of\nthe form “-dd”, which means “dd days ago”.\n\nUse the -reverse switch to make pick find matching messages in reverse  order,  working  from\nthe  highest  message  number down to the lowest.  This can be useful in searching for recent\nmessages in large folders, for example,\n\npick -reverse -from frated | xargs -n1 scan\n\npick supports complex boolean operations on the searching  primitives  with  the  -and,  -or,",
            "subsections": [
                {
                    "name": "-not -lbrace ...  -rbrace",
                    "content": "pick -after yesterday -and\n-lbrace -from freida -or -from fear -rbrace\n\nidentifies messages recently sent by “frieda” or “fear”.\n\nThe  matching primitives take precedence over the -not switch, which in turn takes precedence\nover -and which in turn takes precedence over -or.  To override the default  precedence,  the"
                },
                {
                    "name": "-lbrace   -rbrace",
                    "content": "ses in logical expressions.\n\nIf no search criteria are given, all the messages specified on the command line are  selected\n(this defaults to “all”).\n\nOnce  the search has been performed, if the -list switch is given, the message numbers of the\nselected messages are written to the standard output separated  by  newlines.   This  is  ex‐\ntremely  useful  for  quickly generating arguments for other nmh programs by using the “back‐\nquoting” syntax of the shell.  For example, the command\n\nscan `pick +todo -after “31 Mar 83 0123 PST”`\n\nsays to scan those messages in the indicated folder which  meet  the  appropriate  criterion.\nNote  that  since pick's context changes are written out prior to scan's invocation, you need\nnot give the folder argument to scan as well.\n\nThe -sequence name switch may be given once for each sequence the user wishes to define.  For\neach sequence named, that sequence will be defined to mean exactly those messages selected by\npick.  For example,\n\npick -from frated -seq fred\n\ndefines a new message sequence for the current folder called “fred”  which  contains  exactly\nthose messages that were selected.\n\nThe  -nosequence  switch  will  disable all previously named sequences, allowing those estab‐\nlished by a profile component to be overridden.\n\nBy default, pick will zero a sequence before adding it.  This action can be disabled with the"
                },
                {
                    "name": "-nozero",
                    "content": "if it already exists, and any messages already a part of that sequence will remain so.\n\nThe -public and -nopublic switches are used by pick in the same way mark uses them.\n\nThe -debug switch causes pick to output a representation of the search pattern.\n"
                },
                {
                    "name": "Output when no messages are matched",
                    "content": "If pick is used in a backquoted operation, such as\n\nscan `pick -from jones`\n\nand pick selects no messages (e.g., no messages are from “jones”), then the shell will  still\nrun the outer command (e.g., scan).  Since no messages were matched, pick produced no output,\nand the argument given to the outer command as a result of backquoting pick is empty.  In the\ncase  of nmh programs, the outer command now acts as if the default `msg' or `msgs' should be\nused (e.g., “all” in the case of scan).  To prevent this unexpected behavior,  if  -list  was\ngiven,  and if its standard output is not a tty, then pick outputs the illegal message number\n“0” when it fails.  This lets the outer command fail gracefully as well.\n"
                }
            ]
        },
        "FILES": {
            "content": "$HOME/.mhprofile          The user profile\n",
            "subsections": []
        },
        "PROFILE COMPONENTS": {
            "content": "Path:                To determine the user's nmh directory\nCurrent-Folder:      To find the default current folder\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "mark(1)\n",
            "subsections": []
        },
        "DEFAULTS": {
            "content": "`+folder' defaults to the current folder\n`msgs' defaults to all\n`-datefield date'\n`-zero'\n`-list' is the default if no `-sequence', `-nolist' otherwise\n",
            "subsections": []
        },
        "CONTEXT": {
            "content": "If a folder is given, it will become the current folder.\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "In previous versions of MH, the pick command would show, scan, or refile  the  selected  mes‐\nsages.   This was rather “inverted logic” from the Unix point of view, so pick was changed to\ndefine sequences and output those sequences.  Hence, pick can be used to generate  the  argu‐\nments  for  all other MH commands, instead of giving pick endless switches for invoking those\ncommands itself.\n\nAlso, previous versions of pick balked if you didn't specify a search string or  a  date/time\nconstraint.  The current version does not, and merely matches the messages you specify.  This\nlets you type something like:\n\nshow `pick last:20 -seq fear`\n\ninstead of typing\n\nmark -add -nozero -seq fear last:20\nshow fear\n\nFinally, timezones used to be ignored when comparing dates: they aren't any more.\n",
            "subsections": []
        },
        "HELPFUL HINTS": {
            "content": "Use “pick sequence -list” to enumerate the messages in a sequence (such as for use by a shell\nscript).\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Any occurrence of -datefield must occur prior to the -after or -before switch it applies to.\n\nThe  pattern  syntax  “[l-r]”  is  not  supported; each letter to be matched must be included\nwithin the square brackets.\n\nnmh-1.8                                      2016-03-12                                    PICK(1mh)",
            "subsections": []
        }
    },
    "summary": "pick - search nmh messages",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "pick -after yesterday -and -lbrace -from freida -or -from fear -rbrace identifies messages recently sent by “frieda” or “fear”. The matching primitives take precedence over the -not switch, which in turn takes precedence over -and which in turn takes precedence over -or. To override the default precedence, the"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "ses in logical expressions. If no search criteria are given, all the messages specified on the command line are selected (this defaults to “all”). Once the search has been performed, if the -list switch is given, the message numbers of the selected messages are written to the standard output separated by newlines. This is ex‐ tremely useful for quickly generating arguments for other nmh programs by using the “back‐ quoting” syntax of the shell. For example, the command scan `pick +todo -after “31 Mar 83 0123 PST”` says to scan those messages in the indicated folder which meet the appropriate criterion. Note that since pick's context changes are written out prior to scan's invocation, you need not give the folder argument to scan as well. The -sequence name switch may be given once for each sequence the user wishes to define. For each sequence named, that sequence will be defined to mean exactly those messages selected by pick. For example, pick -from frated -seq fred defines a new message sequence for the current folder called “fred” which contains exactly those messages that were selected. The -nosequence switch will disable all previously named sequences, allowing those estab‐ lished by a profile component to be overridden. By default, pick will zero a sequence before adding it. This action can be disabled with the"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "if it already exists, and any messages already a part of that sequence will remain so. The -public and -nopublic switches are used by pick in the same way mark uses them. The -debug switch causes pick to output a representation of the search pattern."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "mark",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/mark/1/json"
        }
    ]
}