Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
32
votes
2
answers
37399
views
Where do the words in /usr/share/dict/words come from?
[`/usr/share/dict/words`](https://en.wikipedia.org/wiki/Words_(Unix)) contains lots of words. How is this list generated? Are its contents the same across different Unices? Is there any standard dictating what it must contain? All I've been able to turn up so far is that on Ubuntu/Debian the list co...
[
/usr/share/dict/words
](https://en.wikipedia.org/wiki/Words_(Unix)) contains lots of words. How is this list generated? Are its contents the same across different Unices? Is there any standard dictating what it must contain?
All I've been able to turn up so far is that on Ubuntu/Debian the list comes from the [wordlist](https://packages.debian.org/sid/wordlist) packages, but their descriptions offer no clue on how the lists were actually generated.
Mark Amery
(3220 rep)
Jul 2, 2015, 07:23 PM
• Last activity: Jul 29, 2025, 09:25 PM
1
votes
3
answers
2438
views
Searching /usr/dict/words to find words with certain properties
I would like to write a script to search through /usr/dict/words to find all words that meet some criteria I specify. For example, finding all palindromic words (like "racecar", "madam", etc.) or finding all words where the first and second halves reversed also form a word (like "german" and "manger...
I would like to write a script to search through /usr/dict/words to find all words that meet some criteria I specify. For example, finding all palindromic words (like "racecar", "madam", etc.) or finding all words where the first and second halves reversed also form a word (like "german" and "manger"). The framework of the script would be a simple loop to read each word in the dictionary, and I could change the criteria depending on what I want to look for by substituting an expression or something similar.
I figure I would need to involve regular expressions somehow (or otherwise find a way to look at individual characters in each word). I would also need a way to compare the characters in my current word to the other words in the dictionary (such as with my second example above).
What would be the best tool(s) to use for this task?
user161121
Mar 14, 2016, 11:31 PM
• Last activity: Jul 23, 2025, 10:05 AM
31
votes
4
answers
39192
views
Best Dictionary Software for Linux
Can anyone suggest a good "Dictionary" software in Linux. I have artha, but I am actually expecting a better one. Ok here are things which i look out for in a dictionary: - Good database - Word pronounciation (This is not available in Artha.)
Can anyone suggest a good "Dictionary" software in Linux. I have artha, but I am actually expecting a better one.
Ok here are things which i look out for in a dictionary:
- Good database
- Word pronounciation (This is not available in Artha.)
C.S.
(1833 rep)
Nov 13, 2010, 07:26 PM
• Last activity: Feb 19, 2025, 02:10 PM
0
votes
0
answers
28
views
what fonts do I need for DimSum Chinese Mandarin Tools?
I found [DimSum][1] years ago (I installed it on Windows), it helped me to translate English to Chinese, but unfortunately the project is abandoned, the site is still there, but many links are broken. My problem is I have this tool installed on Linux now (it's a jar file), but the input of this "dic...
I found DimSum years ago (I installed it on Windows), it helped me to translate English to Chinese, but unfortunately the project is abandoned, the site is still there, but many links are broken. My problem is I have this tool installed on Linux now (it's a jar file), but the input of this "dictionary" instead of showing English alphabet (one type in English word or Pinyin and this app will find Chinese equivalent words), it just shows square (□) in the input, and on the site it says that it needed certain Chinese TTF fonts to work (the link is broken) and I have no idea which Chinese fonts I need to install. Anyone out there is using this tool or knows about fonts in Linux can tell me which Chinese font I need to install to solve this problem?
michaelbr
(111 rep)
Feb 15, 2025, 09:38 AM
• Last activity: Feb 15, 2025, 11:07 AM
0
votes
1
answers
166
views
Does /usr/share/dict/words contain personal information?
I am considering including a copy of my `/usr/share/dict/words` file in a public GitHub repository for a project that requires dictionaries. Is this a bad idea, and if so, why? I'm particularly interested in the privacy/security (or even legal?) aspects. Are there common programs that add words to t...
I am considering including a copy of my
/usr/share/dict/words
file in a public GitHub repository for a project that requires dictionaries. Is this a bad idea, and if so, why?
I'm particularly interested in the privacy/security (or even legal?) aspects. Are there common programs that add words to this dictionary, for example if I choose "Add to Dictionary" in a spell checker? Is the file likely to contain any sensitive information, such as my username (I checked that, and it doesn't, but there could be similar things I didn't think to check). It'd be impractical to look through all 104,334 words. Perhaps it's just the usr
in the path making me unnecessarily concerned.
I've read over these questions about where the words come from. However, is it probable that any words have since been added or removed?
I suppose if nothing has changed, I could just get the source. But if some programs added helpful (non-personal) words, I'd want to keep those.
In case it's important, I am running Ubuntu 23.10. But I'd prefer a slightly more general answer, if possible.
### Note
I am fully aware that
- it would be possible to point to the file path in code rather than "hard coding" it into the repo, and
- this may not be the best free English word list .
However, I'm not interested in using a different list *instead* of this one (in such a case, I'd rather just use both). And if I use a list, it's necessary that I can include the actual file.
kviLL
(103 rep)
Jun 3, 2024, 08:20 PM
• Last activity: Jun 4, 2024, 09:14 AM
4
votes
1
answers
215
views
Monolingual french offline commandline dictionary?
As the title says, I'm looking for a monolingual french dictionary that I can query on the commandline, ideally offline. For example to have a low latency way to check the gender of nouns. I looked at the freedict language packs that are available for dictd via apt-get (on Ubuntu), but they all seem...
As the title says, I'm looking for a monolingual french dictionary that I can query on the commandline, ideally offline. For example to have a low latency way to check the gender of nouns.
I looked at the freedict language packs that are available for dictd via apt-get (on Ubuntu), but they all seem to be bilingual?
Does anyone have a suggestion?
user313032
(275 rep)
May 11, 2024, 03:40 PM
• Last activity: May 13, 2024, 08:16 PM
1
votes
0
answers
276
views
Wiktionary for dictd - where to obtain?
I have `dictd` installed and some dictionaries. I'd like to add Wiktionary but websearch does not find it, only bilinguals based on it. Any idea how/where to obtain one? Maybe make into `dict` format from other?
I have
dictd
installed and some dictionaries. I'd like to add Wiktionary but websearch does not find it, only bilinguals based on it. Any idea how/where to obtain one? Maybe make into dict
format from other?
Alex Martian
(1287 rep)
May 9, 2023, 08:11 AM
1
votes
1
answers
169
views
How to remove Firefox supplementary English spellchecking dictionaries?
Normally I have the US English spell-checking dictionary as default then I add others that I need (French, Romanian, etc). But in Fedora 36 Firefox came with a lot of different English dictionaries that fill the menu. [![enter image description here][1]][1] `resource://gre/dictionaries/` shows only...
Normally I have the US English spell-checking dictionary as default then I add others that I need (French, Romanian, etc). But in Fedora 36 Firefox came with a lot of different English dictionaries that fill the menu.

resource://gre/dictionaries/
shows only en-US, and about:addons
only what I have added (French).
---
Edit after comment:
rpm -qa | grep spell | sort
hunspell-1.7.0-19.fc36.x86_64
hunspell-en-0.20140811.1-22.fc36.noarch
hunspell-en-GB-0.20140811.1-22.fc36.noarch
hunspell-en-US-0.20140811.1-22.fc36.noarch
hunspell-filesystem-1.7.0-19.fc36.x86_64
cipricus
(1779 rep)
Jul 18, 2022, 10:36 AM
• Last activity: Jul 19, 2022, 07:21 AM
1
votes
1
answers
3904
views
Ansible convert dictionary to mix of dictionary/array
I use following files: variable file: db.yml ``` x86_64: alpine: version: 3.15.0 debian: version: 11.3.0 aarch64: alpine: version: 3.15.0 debian: version: 11.3.0 ``` playbook: playbook.yml ``` --- - name: "Playbook" hosts: localhost connection: local gather_facts: no tasks: - name: Import variables...
I use following files:
variable file: db.yml
How to run similar command as following:
Basically how to loop through this new db.yml to get value for db.x86_64.alpine.version
x86_64:
alpine:
version: 3.15.0
debian:
version: 11.3.0
aarch64:
alpine:
version: 3.15.0
debian:
version: 11.3.0
playbook: playbook.yml
---
- name: "Playbook"
hosts: localhost
connection: local
gather_facts: no
tasks:
- name: Import variables
ansible.builtin.include_vars:
file: db.yml
name: db
- name: DENUG >>> db
debug:
var: db
- name: DENUG >>> db
debug:
var: db[item].alpine
loop: "{{ db.keys()|list }}"
when: db[item].alpine is defined
Output:
ok: [localhost] => (item=x86_64) => {
"ansible_loop_var": "item",
"db[item].alpine": {
"version": "3.15.0"
},
"item": "x86_64"
}
ok: [localhost] => (item=aarch64) => {
"ansible_loop_var": "item",
"db[item].alpine": {
"version": "3.15.0"
},
"item": "aarch64"
}
Now I have converted db.yml to new style as following:
x86_64:
- distribution: alpine
version: 3.15.0
- distribution: debian
version: 11.3.0
aarch64:
- distribution: alpine
version: 3.15.0
- distribution: debian
version: 11.3.0
Question: How to run similar command as following:
- name: DENUG >>> db
debug:
var: db[item].alpine
loop: "{{ db.keys()|list }}"
when: db[item].alpine is defined
and get the same result as available in the output. Basically how to loop through this new db.yml to get value for db.x86_64.alpine.version
Rafal Niznik
(333 rep)
Apr 19, 2022, 01:25 PM
• Last activity: Apr 19, 2022, 11:08 PM
1
votes
1
answers
183
views
Right syntax of dictionary of key/value pairs
I read through the docs [here][1] and [here][2]. My goal is to configure a ip-sec VPN connection from `nmcli` only. I run Ubuntu 20.04 Server without X Server. I already have a connection file on another machine, so I have all the information needed: [connection] id=myVPN uuid=blabla-blabla-blabla t...
I read through the docs here and here . My goal is to configure a ip-sec VPN connection from
nmcli
only. I run Ubuntu 20.04 Server without X Server.
I already have a connection file on another machine, so I have all the information needed:
[connection]
id=myVPN
uuid=blabla-blabla-blabla
type=vpn
autoconnect=false
permissions=user:mark:;
[vpn]
IKE DH Group=dh2
IPSec ID=myID
IPSec gateway=myGateway
IPSec secret-flags=1
Local Port=0
NAT Traversal Mode=natt
Perfect Forward Secrecy=server
Vendor=cisco
Xauth password-flags=1
Xauth username=myUser
ipsec-secret-type=save
xauth-password-type=save
service-type=org.freedesktop.NetworkManager.vpnc
[ipv4]
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
[proxy]
Here my first try:
sudo nmcli connection add connection.id myVPN connection.type vpn connection.autoconnect false connection.permissions mark vpn.data {"IKE DH Group"="dh2" "IPSec ID"="myID" "IPSec gateway"="myGateway" "IPSec secret-flags"="1" "Local Port"="0" "NAT Traversal Mode"="natt" "Perfect Forward Secrecy"="server" "Vendor"="cisco" "Xauth password-flags"="1" "Xauth username"="myUser" "ipsec-secret-type"="save" "xauth-password-type"="save" } vpn.service-type=org.freedesktop.NetworkManager.vpnc
It fails with the following error:
> Error: invalid \.\ 'IPSec ID=myID'
I understood it wants the .
instead of the =
to assign the key/value pairs.
Here my second try:
> Error: failed to modify vpn.data: '{IKE DH Group.dh2' is not valid; use =
Now it says the opposite: it wants the `= sign.
What is the correct syntax to set those key/value pairs?
Mark
(815 rep)
Oct 10, 2021, 06:25 AM
• Last activity: Oct 10, 2021, 04:54 PM
0
votes
1
answers
261
views
Iterate over keys and use in subprocess in python
I have a script in which I have created a function which reads from a config file. ``` def file_reader(): config_dict = {} configParser = configparser.ConfigParser() configParser.read('config.ini') for section_name in configParser.sections(): print('Sections:', section_name) print(' Options:', confi...
I have a script in which I have created a function which reads from a config file.
def file_reader():
config_dict = {}
configParser = configparser.ConfigParser()
configParser.read('config.ini')
for section_name in configParser.sections():
print('Sections:', section_name)
print(' Options:', configParser.options(section_name))
#for (each_key, each_value) in configParser.items(section_name):
#config_dict[each_key] = each_value
config_dict = dict(configParser.items(section_name))
print(config_dict)
return config_dict
The output I get is as follows:
Sections: my-config
Options: ['path1', 'path2', 'path3']
{'path1': '"/home/asad.javed/stop-services.sh"', 'path2': '"/home/asad.javed/script.py"', 'path3': '"/home/asad.javed/getbps.sh ens6f0"'}
My config file looks like this:
cat config.ini
[my-config]
path1 = "/home/asad.javed/stop-services.sh"
path2 = "/home/asad.javed/script.py"
path3 = "/home/asad.javed/getbps.sh ens6f0"
My config file consists of paths that I need to run as external programs. How can I just use the keys, iterate over them and use in subprocess to run external programs sequentially?
Asad Javed
(1 rep)
Sep 16, 2021, 01:44 PM
• Last activity: Oct 8, 2021, 02:30 PM
0
votes
1
answers
3103
views
Dictionary in shell script only showing last associated item
I am trying to use dictionaries and stumbled across a weird behavior. When I create a dictionary like this: ```bash declare -A servers servers=( ["omega"]="dev" ["delta"]="test" ["beta"]="ppd" ["alpha"]="prd" ) echo "${servers["omega"]}" ``` The last element "prd" will be printed to the screen, not...
I am trying to use dictionaries and stumbled across a weird behavior. When I create a dictionary like this:
declare -A servers
servers=( ["omega"]="dev" ["delta"]="test" ["beta"]="ppd" ["alpha"]="prd" )
echo "${servers["omega"]}"
The last element "prd" will be printed to the screen, not the first one. Deleting every entry except the first one will result in the correct output. I am not sure what I am doing wrong because every code example I had a look at is using dictionaries like above. Can anyone spot my mistake?
Greetings
Scriptinator
(1 rep)
Jan 30, 2020, 12:58 PM
• Last activity: Mar 26, 2021, 11:01 AM
4
votes
1
answers
201
views
Where can I find a Welsh word list?
I am looking for a Welsh language word list on my Ubuntu system. `apt-file search /usr/share/dict/` doesn't show an option. However [aspell-cy][1] does exist. The official description is "This package contains all the required files to add support for the Welsh language to the GNU Aspell spell check...
I am looking for a Welsh language word list on my Ubuntu system.
apt-file search /usr/share/dict/
doesn't show an option. However aspell-cy does exist. The official description is "This package contains all the required files to add support for the Welsh language to the GNU Aspell spell checker." I have installed it but can't find the word list it should be using.
Where can I find a Welsh language word list?
Simd
(371 rep)
Jan 28, 2021, 05:09 PM
• Last activity: Jan 28, 2021, 06:58 PM
0
votes
0
answers
782
views
Nvim: Warning: Cannot find word list "cz.utf-8.spl" or "cz.ascii.spl"
When I turn on spell checking for Czech language, this happens: ``` :Sccz No spell file for "cz" in utf-8 Download it? Downloading cz.utf-8.spl... :!curl 'http://ftp.vim.org/pub/vim/runtime/spell/cz.utf-8.spl' -L -o '/tmp/nvimfQsady/1.spl' % Total % Received % Xferd Average Speed Time Time Time Curr...
When I turn on spell checking for Czech language, this happens:
:Sccz
No spell file for "cz" in utf-8
Download it?
Downloading cz.utf-8.spl...
:!curl 'http://ftp.vim.org/pub/vim/runtime/spell/cz.utf-8.spl ' -L -o '/tmp/nvimfQsady/1.spl'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 309 100 309 0 0 1931 0 --:--:-- --:--:-- --:--:-- 1931
"/tmp/nvimfQsady/1.spl" 9L, 309C
Could not find it, trying cz.ascii.spl...
:!curl 'http://ftp.vim.org/pub/vim/runtime/spell/cz.ascii.spl ' -L -o '/tmp/nvimfQsady/1.spl'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 309 100 309 0 0 1861 0 --:--:-- --:--:-- --:--:-- 1861
"/tmp/nvimfQsady/1.spl" 9L, 309C
Download failed
Warning: Cannot find word list "cz.utf-8.spl" or "cz.ascii.spl"
Press ENTER or type command to continue
How can I fix this problem ?
Jan Černý
(1723 rep)
Sep 26, 2020, 10:01 PM
4
votes
1
answers
4062
views
How do I properly convert the file to UTF-16LE encoding without strange characters appearing in the file?
I'm having some peculiarities with the dictionary file of .dsl format I'm trying to convert. It's essentially a text file with the dictionary pairs. The dictionary software I use is GoldenDict. It requires UTF-16 dictionaries so they render properly. All the dictionaries I have are UTF-16LE format....
I'm having some peculiarities with the dictionary file of .dsl format I'm trying to convert. It's essentially a text file with the dictionary pairs. The dictionary software I use is GoldenDict. It requires UTF-16 dictionaries so they render properly.
All the dictionaries I have are UTF-16LE format. There is one standing out however. It has iso-8859-1 encoding. An entry looks like this when I open it with vim:
abandonarse
[m2][c crimson][b]Sinónimos[/b][/c][/m]
[m2][i][c green]verbo[/c][/i][/m]
[m1][trn][b]desanimarse:[/b] >, >, >, >, >, >[/trn][/m]
I have to convert it to UTF-16LE because Goldendict renders some Cyrillic characters instead of Spanish accented characters.
Then I try:
iconv -f iso-8859-1 -t utf-16le dictionary.dsl -o test.dsl
The new test.dsl dictionary is rendered correctly by Goldendict, however I can see some peculiar things I would love to get rid of. First is that the just converted file's encoding is not recognized as it usually is with the other dictionaries:
aleksandr@desktop:~/windoc/Dic/Es extra/dictionary.dsl> file dictionary.dsl
dictionary: data
When I open the file test.dsl with vim every character inside has ^@ added to it. Here is the example of the same entry:
^@^@>^@,^@ ^@^@>^@[^@/^@t^@r^@n^@]^@[^@/^@m^@]^@
^@ ^@[^@m^@2^@]^@[^@c^@ ^@c^@r^@i^@m^@s^@o^@n^@]^@[^@b^@]^@A^@n^@t^@ó^@n^@i^@m^@o^@s^@[^@/^@b^@]^@[^@/^@c^@]^@[^@/^@m^@]^@
^@ ^@[^@m^@2^@]^@[^@i^@]^@[^@c^@ ^@g^@r^@e^@e^@n^@]^@v^@e^@r^@b^@o^@[^@/^@c^@]^@[^@/^@i^@]^@[^@/^@m^@]^@
I tried removing this characters in vim
%s///g
However, then I save the file, it has the encoding iso-8859-1 again.
I would like to have this file to be show without ^@ characters, because I may need to edit some headings in the dictionary manually.
user7748093
(43 rep)
Sep 8, 2020, 03:14 PM
• Last activity: Sep 9, 2020, 04:46 PM
0
votes
1
answers
505
views
Claws-Mail Spell Checker Not Finding hunspell-en_CA
I'm running the latest Claws-Mail (v3.17.6) on Arch Linux and downloaded the latest hunspell-en_CA package (v2019.10.06). When I go to 'Configuration > Preferences > Spell Checking' the 'Default Dictionary' drop down has nothing in it. I found the hunspell dictionary files are located in '/usr/share...
I'm running the latest Claws-Mail (v3.17.6) on Arch Linux and downloaded the latest hunspell-en_CA package (v2019.10.06). When I go to 'Configuration > Preferences > Spell Checking' the 'Default Dictionary' drop down has nothing in it.
I found the hunspell dictionary files are located in '/usr/share/hunspell/'. Is Claws-Mail looking in a different directory? Can I maybe link to these files?
Does anyone know how to get this working in Claw-Mail?
EDIT:
Here's the error message that I get when I compose or reply/forward to an email.
`Spell checker could not be started.
Couldn't initialize None dictionary: (null)
Couldn't initialize None speller.`
Thanks in advance!
DD-Nerd
(65 rep)
Aug 1, 2020, 12:14 PM
• Last activity: Aug 4, 2020, 08:05 PM
1
votes
1
answers
1361
views
Ansible - template from dictionary item
Ansible - template from dictionary item 1'st: Trying to write task which creates files from template ``` NODES: node1: server: host1 script: manage1 node2: server: host2 script: manage2 node3: server: host3 - name: Create files from templates template: src: "templ.j2" dest: "/etc/init.d/{{item.key}}...
Ansible - template from dictionary item
1'st:
Trying to write task which creates files from template
NODES:
node1:
server: host1
script: manage1
node2:
server: host2
script: manage2
node3:
server: host3
- name: Create files from templates
template:
src: "templ.j2"
dest: "/etc/init.d/{{item.key}}"
loop: "{{NODES|dict2items}}"
when: "{{ 'script' in item.value }}"
Above creates files:
/etc/init.d/node1
/etc/init.d/node2
I can't find a way to get:
/etc/init.d/manage1
/etc/init.d/manage2
2'nd question:
during looking for above changed dictionary into list of hashes, ( I'd rather stay with dictionaries ):
NODES:
- node1:
server: host1
script: manage1
- node2:
server: host2
script: manage2
for above list simple file creation works correctly:
- name: Create files
file:
path: "/etc/init.d/{{item.script}}"
state: touch
with_items: "{{ NODES }}"
but analogical file creation from template does not:
- name: Create files template
file:
dest: "/etc/init.d/{{item.script}}"
src: templ.j2
with_items: "{{ NODES }}"
I'm starting with Ansible, and is not easy to understand especially second case.
hubizx
(11 rep)
Apr 26, 2020, 05:00 PM
• Last activity: Jul 30, 2020, 07:22 PM
1
votes
0
answers
35
views
How do I add an extra dictionary/ custom dictionary for fiction writing in Open Office?
[![picture of OpenOffice with right click menu open to adding new word to dictionary standard.dic][1]][1] [1]: https://i.sstatic.net/dtNam.png So as I add custom definition using my story, it's just adding them to Standard. Is there some way to split off custom words just for my fic?

Watercolor
(11 rep)
Oct 6, 2019, 03:20 AM
• Last activity: Oct 6, 2019, 10:27 AM
4
votes
3
answers
2660
views
Who or what compiled /usr/share/dict/words?
Wikipedia says it's part of the wishlist Wordlist or Words package > On Debian and Ubuntu, the words file is provided by the wordlist package, or its provider packages wbritish, wamerican, etc. On Fedora and Arch, the words file is provided by the words package. [Wiki](https://en.wikipedia.org/wiki/...
Wikipedia says it's part of the wishlist
Wordlist or Words package
> On Debian and Ubuntu, the words file is provided by the wordlist package, or its provider packages wbritish, wamerican, etc. On Fedora and Arch, the words file is provided by the words package.
[Wiki](https://en.wikipedia.org/wiki/Words_(Unix))
But from where is this compiled? I've been using it to 'help' solve crosswords at work, but there's a lot of words it is missing, and a lot that I don't recognise.
What are the origins of this file?
AncientSwordRage
(1854 rep)
May 31, 2016, 10:50 PM
• Last activity: Aug 17, 2019, 06:18 AM
0
votes
0
answers
93
views
Remove words from dictionary which has two or more letters at any plave in wor
Basicaly I have dictionary from which I would like to remove words which contain two or more letters at any place in sentence for ex. bold leTTer reMoveMe quote lanGuaGe spaces Output should be like this bold quote space Is it possible to do it with seed ?
Basicaly I have dictionary from which I would like to remove words which contain two or more letters at any place in sentence for ex.
bold
leTTer
reMoveMe
quote
lanGuaGe
spaces
Output should be like this
bold
quote
space
Is it possible to do it with seed ?
Slobodan Vidovic
(185 rep)
May 26, 2019, 10:13 PM
Showing page 1 of 20 total questions