Man page for nntpid


nntpid – retrieve a single article from a news server


nntpid [ -v ] [ -d ] article [ article... ]
nntpid [ -v ] [ -d ]
nntpid [ -v ] -a newsgroup-name


nntpid makes a connection to a news server, retrieves one or more articles, and displays them.

You can specify the article you want by either:

By default, nntpid will try to display the article using a pager (more(1), unless you have specified an alternative in the environment variable PAGER). This is partly for convenience, and partly a mild security measure: it gives you some protection against the news article potentially containing control sequences that cause unexpected behaviour in your terminal. If nntpid detects that its standard output is not a terminal, however, it will bypass the pager and just write out the article directly.

There are a couple of alternative mode of operation. In one, enabled by the -a option, nntpid retrieves all available articles in the group and writes them to standard output in mbox format. In the other, enabled with -b, nntpid simply prints the lowest and highest article numbers currently available in that group from the news server.

The location of the news server is obtained by reading the environment variable NNTPSERVER, or failing that the file /etc/nntpserver.


nntpid will attempt to interpret its argument list as specifying a series of news articles, as follows:

For example, the following invocations should all behave identically. (Single quotes are intended to represent POSIX shell quoting, not part of the command line as it reaches nntpid.)

$ nntpid '<>' misc.test 1234
$ nntpid '' misc.test:1234
$ nntpid 'wibble <> blah' 'misc.test 1234'

If nntpid is given no arguments at all, it will read from standard input. Every line it reads will be interpreted as described above, except that whitespace will also be trimmed from the start and end of the line first.

If you provide the -a option (see below), none of the above applies. Instead, nntpid will expect exactly one command-line argument, which it will treat as a newsgroup name.


Verbose mode. In this mode, nntpid will log its entire conversation with the news server on standard error.
Direct output. In this mode, nntpid will write the article straight to standard output without bothering to try using a pager.
Retrieve all articles from the given newsgroup. In this mode, nntpid will always write straight to standard output (so the -d option is unnecessary).
Print the current bounds on that group's article numbers. The output is one line consisting of a minimum and maximum article number. (Not every article in that range will necessarily actually exist: a cancelled article will still use up a space in the numbering range.)


Currently, the only form of authentication supported by nntpid is AUTHINFO GENERIC, using the environment variable NNTPAUTH. It will only attempt this if it receives a 480 response from the news server; if your news server never sends 480 then nntpid will never even look at NNTPAUTH.


nntpid is free software, distributed under the MIT licence. Type nntpid --licence to see the full licence text.

[nntpid version 20230903.c678881]