mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
translated
This commit is contained in:
parent
c13164c4ae
commit
8302d8c846
@ -7,32 +7,33 @@
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Wordsmith on the Linux command line with dict
|
||||
在 Linux 命令行上使用 dict 文字工具
|
||||
======
|
||||
|
||||
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.
|
||||
作为一个作家,我经常需要确定单词的正确拼写或定义。我还需要使用词库来寻找替代词,这些词的内涵可能与我可能使用的词有些不同。因为我经常使用 Linux 命令行和文本模式工具来完成我的大部分工作,所以使用命令行词典是有意义的。
|
||||
|
||||
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 `dict` command for many years and I have come to depend on it.
|
||||
我非常喜欢使用命令行,原因有很多,其中最主要的原因是它对我来说更有效率。它也比任何一本或多本实体纸质字典,都要全面得多。我使用 Linux 的 `dict` 命令已经很多年了,我已经开始依赖它了。
|
||||
|
||||
### Install dict on Linux
|
||||
### 在 Linux 上安装 dict
|
||||
|
||||
The dict program is not installed by default on Fedora, but it's easy to install. Here is how to install it on Fedora and similar programs:
|
||||
dict 程序在 Fedora 上没有默认安装,但它很容易安装。以下是如何在 Fedora 或类似发行版上安装:
|
||||
|
||||
```
|
||||
$ sudo dnf install dictd
|
||||
```
|
||||
|
||||
On Debian and similar programs, you must also install the dictionary definitions:
|
||||
在 Debian 和类似发行版上,你还必须安装字典定义:
|
||||
|
||||
|
||||
```
|
||||
$ sudo apt install dictd dict-gcide
|
||||
```
|
||||
|
||||
No additional configuration is required. The minimalistic `/usr/share/doc/dictd/dict1.conf` file specifies the remote server for the dictionary databases. This tool uses the Dictionary Server Protocol (DICT) on port 2628.
|
||||
不需要额外的配置。最简单的 `/usr/share/doc/dictd/dict1.conf` 文件指定了字典数据库的远程服务器。这个工具使用字典服务器协议(DICT),端口为 2628。
|
||||
|
||||
### Use dict on Linux
|
||||
### 在 Linux 上使用 dict
|
||||
|
||||
In a terminal session as a non-root user, type `dict <word>` to get a list of definitions from one or more dictionaries and the thesaurus. For example, look up the word `memory` this way.
|
||||
在终端会话中,以非 root 用户的身份,输入 `dict <word>` 来获取一个或多个字典和词库的定义列表。例如,以这种方式查找 `memory` 这个词。
|
||||
|
||||
```
|
||||
$ dict memory | less
|
||||
@ -96,15 +97,15 @@ From Bouvier's Law Dictionary, Revised 6th Ed (1856) [bouvier]:
|
||||
by 2 & 3 Wm. IV., c. 71, the time of memory commenced from the reign of
|
||||
```
|
||||
|
||||
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.
|
||||
为了节省空间,我删去了这个结果的大部分内容,同时留下了足够的信息,以提供一个典型结果的概念。你也可以用双引号或单引号将多字短语括起来进行查询。
|
||||
|
||||
```
|
||||
$ dict "air gapped"
|
||||
```
|
||||
|
||||
### Dictionaries
|
||||
### 字典
|
||||
|
||||
The `dict` command uses several online dictionaries, including legal and technical ones. Dictionaries are also available for many languages. You can `list` the available dictionary databases as shown here:
|
||||
`dict` 命令使用一些在线字典,包括法律和技术字典。许多语言的字典也是可用的。你可以`列出`可用的字典数据库,如下面所示:
|
||||
|
||||
```
|
||||
$ dict -D | less
|
||||
@ -132,17 +133,17 @@ Databases available:
|
||||
<SNIP>
|
||||
```
|
||||
|
||||
You can specify individual dictionaries with the `-d` option:
|
||||
你可以用 `-d` 选项指定单个字典:
|
||||
|
||||
```
|
||||
$ dict -d gcide
|
||||
```
|
||||
|
||||
### Endmost Dictum
|
||||
### 总结
|
||||
|
||||
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 `dict` 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.
|
||||
有时使用词库中的词汇并不是最好的写作方法,因为它可能会混淆你的意思。但我确实发现 `dict` 命令在为特定的意思选择最好的词方面有极大的帮助。它还能确保我使用的单词拼写正确。
|
||||
|
||||
There's a dearth of information about dict. The URL [http://www.dict.org/][1] 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 `dict` 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 _that_ 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.
|
||||
关于 dict 的信息很匮乏。 这个 URL [http://www.dict.org/][1] 只提供了一个基于网络的字典界面。手册页涵盖了语法。但是这个命令是一个有用的、有趣的命令,可以随身携带。我承认在发现 `dict` 命令后,我花了很多时间尝试不同的东西,看看结果会是什么。我就是那个读百科全书和字典的孩子。是的,我是_那个_孩子。除了在写作或阅读时是一个有用的工具外,dict 也可以是一个有趣的工具来满足一下好奇心。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -150,7 +151,7 @@ via: https://opensource.com/article/23/2/linux-dict-command
|
||||
|
||||
作者:[David Both][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user