DICT(1)

๐Ÿ‘‘ DICT(1) โ€” like, the manual page, but make it make sense ๐Ÿ’…

okay bestie, gather round, because today we're talking about dict, the DICT Protocol Client โœจ (yes that's the official NAME, and yes it eats, we don't make the rules)


โœจ SYNOPSIS โœจ

the vibe, in code form ๐Ÿซถ

dict word
dict [options] [word]
dict [options] dict://host:port/d:word:database
dict [options] dict://host:port/m:word:database:strategy

๐ŸŒธ DESCRIPTION ๐ŸŒธ

so basically dict is a client for the Dictionary Server Protocol (DICT), which is a TCP transaction based query/response protocol that hands you access to dictionary definitions from a whole set of natural language dictionary databases. iconic behaviour honestly ๐Ÿ’–

exit status is 0 if the operation succeeded, or non-zero otherwise. no cap. and if you wanna know the non-zero ones by heart, go peek at EXIT STATUS below ๐Ÿ‘‡


๐ŸŽ€ OPTIONS ๐ŸŽ€

one bullet per flag, every single one, we do not skip ๐Ÿ’…

  • -h server or --host server โ€” tells it the hostname for the DICT server. server/port combos can also live in the configuration file. if there are no servers in the config file or on the command line, dict will fail, periodt. and if the IP lookup for a server expands into a list of IP addresses (like dict.org does currently), then each IP gets tried in the order listed. slay ๐Ÿ”ฅ
  • -p service or --port service โ€” picks the port (e.g. 2628) or service (e.g. dict) for connections. the default is 2628, as specified in the DICT Protocol RFC. server/port combos can also be specified in the configuration file.
  • -d dbname or --database dbname โ€” says "search this one specific database". default is to search all databases (a "*" from the DICT protocol). heads up though: a "!" in the DICT protocol means search all of the databases until a match is found, and then stop searching. important distinction bestie ๐Ÿ’€
  • -m or --match โ€” instead of printing a definition, it performs a match using the specified strategy.
  • -s strategy or --strategy strategy โ€” specify a matching strategy. by default the server default match strategy is used, which is usually "exact" for definitions, and some form of spelling-correction strategy for matches ("." from the DICT protocol). which strategies even exist depends on the server implementation. for a list of available strategies, see the -S or --strats option ๐Ÿ‘€
  • -C or --nocorrect โ€” usually, if a definition is requested and the word cannot be found, spelling correction is requested from the server, and a list of possible words is provided. this option disables the generation of that list. sometimes you just don't wanna be corrected, iykyk ๐Ÿ™ˆ
  • -c file or --config file โ€” specify the configuration file. the default is to try ~/.dictrc and /etc/dict.conf, using the first file that exists. if a specific configuration file is specified, then the defaults will not be tried. (so don't be out here expecting a fallback, because there isn't one ๐Ÿซ )
  • -D or --dbs โ€” query the server and display a list of available databases.
  • -S or --strats โ€” query the server and display a list of available search strategies.
  • -H or --serverhelp โ€” query the server and display the help information that it provides. it's giving customer service โœจ
  • -i dbname or --info dbname โ€” request information on the specified database (usually the server will provide origination, descriptive, or other information about the database or its contents).
  • -I or --serverinfo โ€” query the server and display information about the server itself.
  • -M or --mime โ€” send the OPTION MIME command to the server.
NOTE: the server's capabilities are not checked. (yes this is also a BUGS entry, it's just that important ๐Ÿ’€)
  • -f or --formatted โ€” enables formatted output, i.e. output convenient for postprocessing by standard UNIX utilities. no, it is not XML ;-) also, error and warning messages like " No matches...", " Invalid strategy..." etc. are sent to stderr, not to stdout. the format is:
-I, -i, -H and similar:
   host<TAB>port
   <SPC><SPC>line1
   <SPC><SPC>line2
   ...
-S:
   host<TAB>port<TAB>strategy1<TAB>short description1
   host<TAB>port<TAB>strategy2<TAB>short description2
   ...
-D:
   host<TAB>port<TAB>database1<TAB>database description1
   host<TAB>port<TAB>database2<TAB>database description2
   ...
-m:
   host<TAB>port<TAB>database1<TAB>match1
   host<TAB>port<TAB>database2<TAB>match2
   ...
  • -a or --noauth โ€” disable authentication (i.e., don't send an AUTH command). just walk in like you own the place ๐Ÿ’…
  • -u user or --user user โ€” specifies the username for authentication.
  • -k key or --key key โ€” specifies the shared secret for authentication. ๐Ÿคซ
  • -V or --version โ€” display version information.
  • -L or --license โ€” display copyright and license information. the legal girlies love this one ๐ŸŽ€
  • -4 โ€” forces dict to use IPv4 addresses only.
  • -6 โ€” forces dict to use IPv6 addresses only.
  • --help โ€” display help information.
  • -v or --verbose โ€” be verbose.
  • -r or --raw โ€” be very verbose: show the raw client/server interaction. the way that it just tells you everything ๐Ÿ”ฅ
  • --pipesize โ€” specify the buffer size for pipelineing commands. the default is 256, which should be sufficient for general tasks and be below the MTU for most transport media. larger values may provide faster or slower throughput, depending on MTU. if the buffer is too small, requests will be serialized. values less than 0 and greater than one million are silently changed to something more reasonable. (silently. no warning. just vibes ๐Ÿ˜ญ)
  • --client text โ€” specifies additional text to be sent using the CLIENT command.
  • --debug flag โ€” set a debugging flag. valid flags are:
    • verbose โ€” the same as -v or --verbose.
    • raw โ€” the same as -r or --raw.
    • scan โ€” debug the scanner for the configuration file.
    • parse โ€” debug the parser for the configuration file.
    • pipe โ€” debug TCP pipelining support (see the DICT RFC and RFC1854).
    • serial โ€” disable pipelining support.
    • time โ€” perform transaction timing. โฑ๏ธ

๐ŸŒˆ CONFIGURATION ๐ŸŒˆ

the configuration file currently has a very simple format. lines are used to specify servers, for example:

server dict.org

or, with options:

server dict.org { port 8080 }
server dict.org { user username secret }
server dict.org { port dict user username secret }

the port and user options may be specified in any order. the port option is used to specify an optional port (e.g. 2628) or service (e.g. dict) for the TCP/IP connection. the user option is used to specify a username and shared secret to be used for authentication to this particular server.

servers are tried in the order listed until a connection is made. first come, first served bestie ๐Ÿซถ


๐Ÿ’€ EXIT STATUS ๐Ÿ’€

here's the full list, and yes, they all matter:

  • 0 โ€” Successful completion
  • 20 โ€” No matches found
  • 21 โ€” Approximate matches found
  • 22 โ€” No databases available
  • 23 โ€” No strategies available
  • 30 โ€” Unexpected response code from server
  • 31 โ€” Server is temporarily unavailable
  • 32 โ€” Server is shutting down
  • 33 โ€” Syntax error, command not recognized
  • 34 โ€” Syntax error, illegal parameters
  • 35 โ€” Command not implemented
  • 36 โ€” Command parameter not implemented
  • 37 โ€” Access denied
  • 38 โ€” Authentication failed
  • 39 โ€” Invalid database
  • 40 โ€” Invalid strategy
  • 41 โ€” Connection to server failed

๐Ÿ’– CREDITS ๐Ÿ’–

dict was written by Rik Faith (faith@cs.unc.edu) and is distributed under the terms of the GNU General Public License. if you need to distribute under other terms, write to the author. โœ๏ธ

the main libraries used by this programs (zlib, regex, libmaa) are distributed under different terms, so you may be able to use the libraries for applications which are incompatible with the GPL โ€” please see the copyright notices and license information that come with the libraries for more information, and consult with your attorney to resolve these issues. (yes, an actual attorney. not me. I'm just a manpage ๐Ÿ’…)


๐Ÿ˜ญ BUGS ๐Ÿ˜ญ

we're being honest here, bestie, because that's what friends do:

  • if a dict: URL is given on the command line, only the first one is used. the rest are ignored. gone. ghosted.
  • if a dict: URL contains a specifier for the nth definition or match of a word, it will be ignored and all the definitions or matches will be provided. this violates the RFC, and will be corrected in a future release.
  • if a dict: URL contains a shared secret, it will not be parsed correctly.
  • when the OPTION MIME command is sent to the server (the -M option), server's capabilities are not checked.

๐Ÿฆ‹ FILES ๐Ÿฆ‹

  • ~/.dictrc โ€” User's dict configuration file
  • /etc/dict.conf โ€” System dict configuration file

โญ SEE ALSO โญ

dictd(8), dictzip(1), http://www.dict.org, RFC 2229


and that's the whole page, bestie!! ๐ŸŽ€ this iconic little manual is dated 15 February 1998 and lives as DICT(1) โ€” go forth, look up words, and be the main character of your own terminal ๐ŸŒธ๐Ÿ’œ

๐Ÿ“ฆ where this page comes from