Redian新闻
>
在 Linux 命令行上使用 dict 文字工具 | Linux 中国

在 Linux 命令行上使用 dict 文字工具 | Linux 中国

科技
 
导读:Linux 上的 dict 命令对作家来说非常有用,可以为他们的选词提供大量的字典和同义词。     
本文字数:4886,阅读时长大约:5分钟

Linux 上的 dict 命令对作家来说非常有用,可以为他们的选词提供大量的字典和同义词。

作为一个作家,我经常需要确定单词的正确拼写或定义。我还需要使用词库来寻找替代词,这些词的内涵可能与我可能使用的词有些不同。因为我经常使用 Linux 命令行和文本模式工具来完成我的大部分工作,所以使用命令行词典是有意义的。

我非常喜欢使用命令行,原因有很多,其中最主要的原因是它对我来说更有效率。它也比任何一本或多本实体纸质字典,都要全面得多。我使用 Linux 的 dict 命令已经很多年了,我已经开始依赖它了。

在 Linux 上安装 dict

dict 程序在 Fedora 上没有默认安装,但它很容易安装。以下是如何在 Fedora 或类似发行版上安装:

  1. $ sudo dnf install dictd

在 Debian 和类似发行版上,你还必须安装字典定义:

  1. $ sudo apt install dictd dict-gcide

不需要额外的配置。这个非常简单的 /usr/share/doc/dictd/dict1.conf 文件指定了字典数据库的远程服务器。这个工具使用字典服务器协议(DICT),端口为 2628。

在 Linux 上使用 dict

在终端会话中,以非 root 用户的身份,输入 dict <word> 来获取一个或多个字典和词库的定义列表。例如,以这种方式查找 memory 这个词。

  1. $ dict memory | less
  2. 6 definitions found
  3. From The Collaborative International Dictionary of English v.0.48 [gcide]:
  4. Memory \Mem"o*ry\, n.; pl. {Memories}. [OE. memorie, OF.
  5. memoire, memorie, F. m['e]moire, L. memoria, fr. memor
  6. mindful; cf. mora delay. Cf. {Demur}, {Martyr}, {Memoir},
  7. {Remember}.]
  8. [1913 Webster]
  9. 1. The faculty of the mind by which it retains the knowledge
  10. of previous thoughts, impressions, or events.
  11. [1913 Webster]
  12. Memory is the purveyor of reason. --Rambler.
  13. [1913 Webster]
  14. 2. The reach and positiveness with which a person can
  15. remember; the strength and trustworthiness of one's power
  16. to reach and represent or to recall the past; as, his
  17. memory was never wrong.
  18. [1913 Webster]
  19. <SNIP>
  20. From WordNet (r) 3.0 (2006) [wn]:
  21. memory
  22. n 1: something that is remembered; "search as he would, the
  23. memory was lost"
  24. 2: the cognitive processes whereby past experience is
  25. remembered; "he can do it from memory"; "he enjoyed
  26. remembering his father" [syn: {memory}, {remembering}]
  27. 3: the power of retaining and recalling past experience; "he had
  28. <SNIP>
  29. From Moby Thesaurus II by Grady Ward, 1.0 [moby-thesaurus]:
  30. 78 Moby Thesaurus words for "memory":
  31. RAM, anamnesis, anniversaries, archetypal pattern, archetype,
  32. awareness, celebrating, celebration, ceremony, cognizance,
  33. commemoration, consciousness, disk memory, dressing ship,
  34. <SNIP>
  35. From The Free On-line Dictionary of Computing (30 December 2018) [foldoc]:
  36. memory
  37. <storage> These days, usually used synonymously with {Random
  38. Access Memory} or {Read-Only Memory}, but in the general sense
  39. it can be any device that can hold {data} in
  40. {machine-readable} format.
  41. (1996-05-25)
  42. From Bouvier's Law Dictionary, Revised 6th Ed (1856) [bouvier]:
  43. MEMORY, TIME OF. According to the English common law, which has been altered
  44. by 2 & 3 Wm. IV., c. 71, the time of memory commenced from the reign of

为了节省空间,我删去了这个结果的大部分内容,同时留下了足够的信息,以提供一个典型结果的概念。你也可以用双引号或单引号将多字短语括起来进行查询。

  1. $ dict "air gapped"

字典

dict 命令使用一些在线字典,包括法律和技术字典。许多语言的字典也是可用的。你可以“列出”可用的字典数据库,如下面所示:

  1. $ dict -D | less
  2. Databases available:
  3. gcide The Collaborative International Dictionary of English v.0.48
  4. wn WordNet (r) 3.0 (2006)
  5. moby-thesaurus Moby Thesaurus II by Grady Ward, 1.0
  6. elements The Elements (07Nov00)
  7. vera V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)
  8. jargon The Jargon File (version 4.4.7, 29 Dec 2003)
  9. foldoc The Free On-line Dictionary of Computing (30 December 2018)
  10. easton Easton's 1897 Bible Dictionary
  11. hitchcock Hitchcock's Bible Names Dictionary (late 1800's)
  12. bouvier Bouvier's Law Dictionary, Revised 6th Ed (1856)
  13. devil The Devil's Dictionary (1881-1906)
  14. world02 CIA World Factbook 2002
  15. gaz2k-counties U.S. Gazetteer Counties (2000)
  16. gaz2k-places U.S. Gazetteer Places (2000)
  17. gaz2k-zips U.S. Gazetteer Zip Code Tabulation Areas (2000)
  18. fd-hrv-eng Croatian-English FreeDict Dictionary ver. 0.1.2
  19. fd-fin-por suomi-português FreeDict+WikDict dictionary ver. 2018.09.13
  20. fd-fin-bul suomi-български език FreeDict+WikDict dictionary ver. 2018.09.13
  21. fd-fra-bul français-български език FreeDict+WikDict dictionary ver. 2018.09.13
  22. fd-deu-swe Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13
  23. <SNIP>

你可以用 -d 选项指定单个字典:

  1. $ dict -d gcide

总结

有时使用词库中的词汇并不是最好的写作方法,因为它可能会混淆你的意思。但我确实发现 dict 命令在为特定的意思选择最好的词方面有极大的帮助。它还能确保我使用的单词拼写正确。

关于 dict 的信息很匮乏。这个 URL http://www.dict.org/ 只提供了一个基于网络的字典界面。手册页涵盖了语法。但是这个命令是一个有用的、有趣的命令,可以随身携带。我承认在发现 dict 命令后,我花了很多时间尝试不同的东西,看看结果会是什么。我就是那个通读百科全书和字典的孩子。是的,我是_那个_孩子。除了在写作或阅读时是一个有用的工具外,dict 也可以是一个有趣的工具来满足一下好奇心。


via: https://opensource.com/article/23/2/linux-dict-command

作者:David Both 选题:lkxed 译者:geekpi 校对:wxy

本文由 LCTT 原创编译,Linux中国 荣誉推出

LCTT 译者 :geekpi
💎💎💎💎
翻译: 1884.5 篇
|
贡献: 3421 天
2013-10-25
2023-03-08
https://linux.cn/lctt/geekpi
欢迎遵照 CC-BY-SA 协议规定转载,
如需转载,请在文章下留言 “转载:公众号名称”,
我们将为您添加白名单,授权“转载文章时可以修改”。


微信扫码关注该文公众号作者

戳这里提交新闻线索和高质量文章给我们。
相关阅读
使用 ChatGPT AI 从英文文本生成 Linux 命令 | Linux 中国美国优胜美地国家公园,翘首观望Just:Spring Boot 应用的新命令行界面开始了!安省禁止在政府拥有的设备上使用TikTok!如何在 Linux 系统中使用 Ventoy 创建多重引导的 U 盘 | Linux 中国在 C 语言中使用 getopt 解析命令行短选项 | Linux 中国2022我的世界名城旅游年who 命令的解释与示例 | Linux 中国Agustín Hernández:中美洲建筑背景下的未来主义巨构【直播预告】揭秘数字工厂,探索中国智造的未来使用开源的思维导图工具 | Linux 中国zip 命令的解释与示例 | Linux 中国SpringBoot 应用的新命令行界面:Just工作太枯燥?那就交给数字工具吧用这个开源工具在 React 中建立一个交互式时间轴 | Linux 中国使用时间序列数据,用开源工具助力你的边缘项目 | Linux 中国天赋“易昺(bǐng)”,创造历史!w 命令的解释与示例 | Linux 中国TUXEDO Stellaris 16(Gen5)是目前所能找到的终极 Linux 笔记本电脑 | Linux 中国使用这些 Python 工具可视化地探索数据 | Linux 中国纯命令行+美观UI,10款实用开源下载工具如何在 Linux 中使用旧相机作为网络摄像头 | Linux 中国CTO:禁止在项目中使用 BeanUtils 属性转换工具。。。Linux 实现简易的 Shell 命令行解释器whereis 命令的解释与示例 | Linux 中国ChatGPT爆火,文字工作者会被取代吗?世界上只有两个 Linux 发行版:Arch Linux 与其它 | Linux 中国Are the Han Chinese indigenous to China?八一厂电影 《许茂和他的女儿们》【妈蜜排骨】Marmite Spare Ribs如何使用 journalctl 查看和分析 systemd 日志(附实例) | Linux 中国非虚构写作营 | ChatGPT爆火,文字工作者会被取代吗?【今晚直播】揭秘数字工厂与中国智造的未来Linux查看进程占用网速和流量使用情况的三个命令:vnstat、iftop、nethogs海报上的文字平平无奇?试试这13款风格独特的免商英文字体!
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。