{"id":71012,"date":"2023-02-06T09:07:53","date_gmt":"2023-02-06T09:07:53","guid":{"rendered":"https:\/\/www.cryptocabaret.com\/?p=71012"},"modified":"2023-02-06T09:07:53","modified_gmt":"2023-02-06T09:07:53","slug":"wordsmith-on-the-linux-command-line-with-dict","status":"publish","type":"post","link":"https:\/\/www.cryptocabaret.com\/?p=71012","title":{"rendered":"Wordsmith on the Linux command line with dict"},"content":{"rendered":"<p><span class=\"field field--name-title field--type-string field--label-hidden\">Wordsmith on the Linux command line with dict<\/span><br \/>\n<span class=\"field field--name-uid field--type-entity-reference field--label-hidden\"><a title=\"View user profile.\" href=\"https:\/\/opensource.com\/users\/dboth\" class=\"username\">dboth<\/a><\/span><br \/>\n<span class=\"field field--name-created field--type-created field--label-hidden\">Mon, 02\/06\/2023 &#8211; 03:00<\/span><\/p>\n<div class=\"clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item\">\n<p>As a writer, I frequently need to determine the correct spelling or definition of words. I also need to use a thesaurus to find alternate words that may have a somewhat different connotation than the one I might otherwise use. Because I frequently use the Linux command line and text-mode tools to do much of my work, it makes sense to use a command line dictionary.<\/p>\n<p>I really like using the command line for a number of reasons, the primary one being that it is more efficient for me. It is also far more comprehensive than any one or multiple physical paper dictionaries, could ever be. I have been using the Linux <code>dict<\/code> command for many years and I have come to depend on it.<\/p>\n<h2>Install dict on Linux<\/h2>\n<p>The dict program is not installed by default on Fedora, but it&#8217;s easy to install. Here is how to install it on Fedora and similar programs:<\/p>\n<pre class=\"highlight\">\n<code class=\"language-bash\" data-lang=\"bash\">$ sudo dnf install dictd<\/code><\/pre>\n<p>On Debian and similar programs, you must also install the dictionary definitions:<\/p>\n<pre class=\"highlight\">\n<code class=\"language-bash\" data-lang=\"bash\">$ sudo apt install dictd dict-gcide<\/code><\/pre>\n<p>No additional configuration is required. The minimalistic <code>\/usr\/share\/doc\/dictd\/dict1.conf<\/code> file specifies the remote server for the dictionary databases. This tool uses the Dictionary Server Protocol (DICT) on port 2628.<\/p>\n<h2>Use dict on Linux<\/h2>\n<p>In a terminal session as a non-root user, type <code>dict <word><\/word><\/code> to get a list of definitions from one or more dictionaries and the thesaurus. For example, look up the word <code>memory<\/code> this way.<\/p>\n<pre class=\"highlight\">\n<code class=\"language-text\" data-lang=\"text\">$ dict memory | less\n6 definitions found\n\nFrom The Collaborative International Dictionary of English v.0.48 [gcide]:\n\n  Memory Mem\"o*ry, n.; pl. {Memories}. [OE. memorie, OF.\n     memoire, memorie, F. m['e]moire, L. memoria, fr. memor\n     mindful; cf. mora delay. Cf. {Demur}, {Martyr}, {Memoir},\n     {Remember}.]\n     [1913 Webster]\n     1. The faculty of the mind by which it retains the knowledge\n        of previous thoughts, impressions, or events.\n        [1913 Webster]\n\n              Memory is the purveyor of reason.     --Rambler.\n        [1913 Webster]\n\n     2. The reach and positiveness with which a person can\n        remember; the strength and trustworthiness of one's power\n        to reach and represent or to recall the past; as, his\n        memory was never wrong.\n        [1913 Webster]\n<snip>\n\nFrom WordNet (r) 3.0 (2006) [wn]:\n\n  memory\n      n 1: something that is remembered; \"search as he would, the\n           memory was lost\"\n      2: the cognitive processes whereby past experience is\n         remembered; \"he can do it from memory\"; \"he enjoyed\n         remembering his father\" [syn: {memory}, {remembering}]\n      3: the power of retaining and recalling past experience; \"he had\n<snip>\n\nFrom Moby Thesaurus II by Grady Ward, 1.0 [moby-thesaurus]:\n\n  78 Moby Thesaurus words for \"memory\":\n     RAM, anamnesis, anniversaries, archetypal pattern, archetype,\n     awareness, celebrating, celebration, ceremony, cognizance,\n     commemoration, consciousness, disk memory, dressing ship,\n<snip>\n\nFrom The Free On-line Dictionary of Computing (30 December 2018) [foldoc]:\n\n  memory\n\n     <storage> These days, usually used synonymously with {Random\n     Access Memory} or {Read-Only Memory}, but in the general sense\n     it can be any device that can hold {data} in\n     {machine-readable} format.\n\n     (1996-05-25)\n\n\nFrom Bouvier's Law Dictionary, Revised 6th Ed (1856) [bouvier]:\n\n  MEMORY, TIME OF. According to the English common law, which has been altered\n  by 2 &amp; 3 Wm. IV., c. 71, the time of memory commenced from the reign of<\/storage><\/snip><\/snip><\/snip><\/code><\/pre>\n<p>I have cut large sections of this result to save space while leaving enough information to provide an idea of what typical results look like. You can also look up multi-word phrases by enclosing them in quotes, either double or single.<\/p>\n<pre class=\"highlight\">\n<code class=\"language-bash\" data-lang=\"bash\">$ dict \"air gapped\"<\/code><\/pre>\n<h2>Dictionaries<\/h2>\n<p>The <code>dict<\/code> command uses several online dictionaries, including legal and technical ones. Dictionaries are also available for many languages. You can <code>list<\/code> the available dictionary databases as shown here:<\/p>\n<pre class=\"highlight\">\n<code class=\"language-bash\" data-lang=\"bash\">$ dict -D | less\nDatabases available:\n gcide          The Collaborative International Dictionary of English v.0.48\n wn             WordNet (r) 3.0 (2006)\n moby-thesaurus Moby Thesaurus II by Grady Ward, 1.0\n elements       The Elements (07Nov00)\n vera           V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)\n jargon         The Jargon File (version 4.4.7, 29 Dec 2003)\n foldoc         The Free On-line Dictionary of Computing (30 December 2018)\n easton         Easton's 1897 Bible Dictionary\n hitchcock      Hitchcock's Bible Names Dictionary (late 1800's)\n bouvier        Bouvier's Law Dictionary, Revised 6th Ed (1856)\n devil          The Devil's Dictionary (1881-1906)\n world02        CIA World Factbook 2002\n gaz2k-counties U.S. Gazetteer Counties (2000)\n gaz2k-places   U.S. Gazetteer Places (2000)\n gaz2k-zips     U.S. Gazetteer Zip Code Tabulation Areas (2000)\n fd-hrv-eng     Croatian-English FreeDict Dictionary ver. 0.1.2\n fd-fin-por     suomi-portugu\u00eas FreeDict+WikDict dictionary ver. 2018.09.13\n fd-fin-bul     suomi-\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a FreeDict+WikDict dictionary ver. 2018.09.13\n fd-fra-bul     fran\u00e7ais-\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a FreeDict+WikDict dictionary ver. 2018.09.13\n fd-deu-swe     Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13\n<snip><\/snip><\/code><\/pre>\n<\/p>\n<div class=\"embedded-resource-list callout-float-right\">\n<div class=\"field field--name-title field--type-string field--label-hidden field__item\">More Linux resources<\/div>\n<div class=\"field field--name-links field--type-link field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/developers.redhat.com\/cheat-sheets\/linux-commands-cheat-sheet\/?intcmp=70160000000h1jYAAQ\">Linux commands cheat sheet<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/developers.redhat.com\/cheat-sheets\/advanced-linux-commands\/?intcmp=70160000000h1jYAAQ\">Advanced Linux commands cheat sheet<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/www.redhat.com\/en\/services\/training\/rh024-red-hat-linux-technical-overview?intcmp=70160000000h1jYAAQ\">Free online course: RHEL technical overview<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/cheat-sheet-networking?intcmp=70160000000h1jYAAQ\">Linux networking cheat sheet<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/cheat-sheet-selinux?intcmp=70160000000h1jYAAQ\">SELinux cheat sheet<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/linux-common-commands-cheat-sheet?intcmp=70160000000h1jYAAQ\">Linux common commands cheat sheet<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/resources\/what-are-linux-containers?intcmp=70160000000h1jYAAQ\">What are Linux containers?<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/linux?intcmp=70160000000h1jYAAQ\">Our latest Linux articles<\/a><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<p>You can specify individual dictionaries with the <code>-d<\/code> option:<\/p>\n<pre class=\"highlight\">\n<code class=\"language-bash\" data-lang=\"bash\">$ dict -d gcide<\/code><\/pre>\n<h2>Endmost Dictum<\/h2>\n<p>Sometimes using words found in the thesaurus is not the best approach to writing as it can obfuscate your meaning. But I do find that the <code>dict<\/code> command can be immensely useful in choosing the best word for a specific meaning. It also ensures that the words I use are spelled correctly.<\/p>\n<p>There&#8217;s a dearth of information about dict. The URL <a class=\"bare\" href=\"http:\/\/www.dict.org\/\" rel=\"noopener\" target=\"_blank\">http:\/\/www.dict.org\/<\/a> provides only a web-based interface to the dictionaries. The man page covers syntax. But the command is a useful and fun command to have handy. I admit that after discovering the <code>dict<\/code> command I spent many hours of the day just trying different things to see what the result would be. I was the kid who read the encyclopedia and dictionary. Yes, I was <em>that<\/em> kid. In addition to being a useful tool when writing or reading, dict can also be a fun tool to satisfy a bit of curiosity.<\/p>\n<\/div>\n<div class=\"clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item\">\n<p>The dict command on Linux is useful for writers to access a plethora of dictionaries and synonyms for their word choices.<\/p>\n<\/div>\n<div class=\"field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item\">\n<article class=\"media media--type-image media--view-mode-caption\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2023\/02\/doc-dish-lead.png\" width=\"520\" height=\"292\" alt=\"Typewriter in the grass\" title=\"Typewriter in the grass\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>Original photo by jetheriot. Modified by Rikki Endsley. CC BY-SA 2.0.<\/p>\n<\/div>\n<\/article>\n<\/div>\n<div class=\"field field--name-field-tags field--type-entity-reference field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/linux\" hreflang=\"en\">Linux<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/command-line\" hreflang=\"en\">Command line<\/a><\/div>\n<\/p><\/div>\n<div class=\"hidden field field--name-field-listicle-title field--type-string field--label-hidden field__item\">What to read next<\/div>\n<div class=\"field field--name-field-default-license field--type-list-string field--label-hidden field__item\"><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><br \/>\n        <img decoding=\"async\" alt=\"Creative Commons License\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2023\/02\/cc-by-sa-4-8.png\" title=\"This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.\"><\/a>This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.<\/div>\n<section class=\"field field--name-field-comments field--type-comment field--label-hidden comment-wrapper\">\n<div class=\"comments__count\">\n<div class=\"login\"><a href=\"https:\/\/opensource.com\/user\/register?absolute=1\">Register<\/a> or <a href=\"https:\/\/opensource.com\/user\/login?destination=\/feed&amp;absolute=1\">Login<\/a> to post a comment.<\/div>\n<\/p><\/div>\n<\/section>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\" rel=\"noopener\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wordsmith on the Linux command line with dict dboth Mon, 02\/06\/2023 &#8211; 03:00 As a writer, I frequently need to determine the correct spelling or definition of words. I also need to use a thesaurus to find alternate words that may have a somewhat different connotation than the one I might otherwise use. Because I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":71013,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[307],"tags":[],"class_list":["post-71012","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source"],"_links":{"self":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/71012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=71012"}],"version-history":[{"count":0,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/71012\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/media\/71013"}],"wp:attachment":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=71012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=71012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=71012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}