| 1 |
= isoquery(1) |
| 2 |
Dr. Tobias Quathamer <[email protected]> |
| 3 |
:doctype: manpage |
| 4 |
:docdate: 2026-07-19 |
| 5 |
:man source: 3.4.0 |
| 6 |
:!author: |
| 7 |
|
| 8 |
== Name |
| 9 |
|
| 10 |
isoquery - search and display various ISO codes (country, language, …) |
| 11 |
|
| 12 |
== Synopsis |
| 13 |
|
| 14 |
*isoquery* [_OPTION …_] [_ISO codes_] |
| 15 |
|
| 16 |
== Description |
| 17 |
|
| 18 |
This manual page documents briefly the *isoquery* command. |
| 19 |
It can be used to generate a tabular output of the ISO standard |
| 20 |
codes provided by the package *iso-codes*. |
| 21 |
It parses the JSON files and shows all included ISO codes or just |
| 22 |
matching entries, if specified on the command line. |
| 23 |
Moreover, it's possible to get all available translations for |
| 24 |
the ISO standard. |
| 25 |
|
| 26 |
== Options |
| 27 |
|
| 28 |
This program follows the usual GNU command line syntax, with long options |
| 29 |
starting with two dashes ('*-*'). *isoquery* supports the following options: |
| 30 |
|
| 31 |
*-i, --iso*=_STANDARD_:: |
| 32 |
The ISO standard to use. Possible values: 639-2, 639-3, 639-5, 3166-1, |
| 33 |
3166-2, 3166-3, 4217, 15924 (default: 3166-1) |
| 34 |
|
| 35 |
*-p, --pathname*=_PATHNAME_:: |
| 36 |
Use _PATHNAME_ as prefix for the data files (default: /usr/share/iso-codes/json) |
| 37 |
|
| 38 |
*-l, --locale*=_LOCALE_:: |
| 39 |
Use this _LOCALE_ for output |
| 40 |
|
| 41 |
*-n, --name*:: |
| 42 |
Name for the supplied codes (default) |
| 43 |
|
| 44 |
*-o, --official_name*:: |
| 45 |
Official name for the supplied codes. This may be the same |
| 46 |
as *--name* (only applies to ISO 3166-1) |
| 47 |
|
| 48 |
*-c, --common_name*:: |
| 49 |
Common name for the supplied codes. This may be the same |
| 50 |
as *--name* (only applies to ISO 639-2, 639-3, and 3166-1) |
| 51 |
|
| 52 |
*-0, --null*:: |
| 53 |
Separate entries with a NULL character instead of newline |
| 54 |
|
| 55 |
*-f, --flag*:: |
| 56 |
Show country flags with regional indicator symbol letters |
| 57 |
(only applies to ISO 3166-1) |
| 58 |
|
| 59 |
*-h, --help*:: |
| 60 |
Show summary of options |
| 61 |
|
| 62 |
*-v, --version*:: |
| 63 |
Show program version and copyright |
| 64 |
|
| 65 |
== Examples |
| 66 |
|
| 67 |
If called without any command line options, *isoquery* will print a |
| 68 |
table of all ISO 3166-1 codes. The first three columns contain the alpha-2 code, |
| 69 |
the alpha-3 code, and the numerical code assigned to the country listed |
| 70 |
in the fourth column. |
| 71 |
|
| 72 |
.... |
| 73 |
$ isoquery |
| 74 |
AW ABW 533 Aruba |
| 75 |
[…] |
| 76 |
ZW ZWE 716 Zimbabwe |
| 77 |
.... |
| 78 |
|
| 79 |
If you need only some countries, you can specify any of the codes in |
| 80 |
the first three columns to cut down the output. |
| 81 |
|
| 82 |
.... |
| 83 |
$ isoquery so nor 484 |
| 84 |
SO SOM 706 Somalia |
| 85 |
NO NOR 578 Norway |
| 86 |
MX MEX 484 Mexico |
| 87 |
.... |
| 88 |
|
| 89 |
Should you need the translations of the countries' names, just specify |
| 90 |
in which _LOCALE_ you'd like to see the output. |
| 91 |
Please note that the original English name will be shown if there is no |
| 92 |
translation available for the specified _LOCALE_. |
| 93 |
|
| 94 |
.... |
| 95 |
$ isoquery --locale=nl fr de es |
| 96 |
FR FRA 250 Frankrijk |
| 97 |
DE DEU 276 Duitsland |
| 98 |
ES ESP 724 Spanje |
| 99 |
.... |
| 100 |
|
| 101 |
If your terminal supports the unicode regional indicator symbol |
| 102 |
letters, you can use the *--flag* command line option. Those |
| 103 |
letters can be displayed as a country flag. |
| 104 |
|
| 105 |
.... |
| 106 |
$ isoquery --flag --locale=nl fr de es |
| 107 |
FR FRA 250 🇫🇷 Frankrijk |
| 108 |
DE DEU 276 🇩🇪 Duitsland |
| 109 |
ES ESP 724 🇪🇸 Spanje |
| 110 |
.... |
| 111 |
|
| 112 |
All of the above works for different ISO standards as well, so you can |
| 113 |
switch to the more extensive standard ISO 3166-2 by using the *--iso* command |
| 114 |
line option. The columns are ISO 3166-2 code, subset type (e.g. State, Province, |
| 115 |
etc.), parent, and name. The third column (parent) may be empty. |
| 116 |
|
| 117 |
.... |
| 118 |
$ isoquery --iso=3166-2 |
| 119 |
AD-02 Parish Canillo |
| 120 |
[…] |
| 121 |
ZW-MW Province Mashonaland West |
| 122 |
.... |
| 123 |
|
| 124 |
Codes which have been deleted from ISO 3166-1 are available in ISO 3166-3. |
| 125 |
The columns are alpha-3 code, alpha-4 code, numeric code, comment, |
| 126 |
withdrawal date, and name. The columns for numeric code, comment, and |
| 127 |
withdrawal date may be empty. |
| 128 |
|
| 129 |
.... |
| 130 |
$ isoquery --iso=3166-3 |
| 131 |
AFI AIDJ 262 1977 French Afars and Issas |
| 132 |
ANT ANHH 532 1993-07-12 Netherlands Antilles |
| 133 |
[…] |
| 134 |
YUG YUCS 891 1993-07-28 Yugoslavia, Socialist Federal Republic of |
| 135 |
ZAR ZRCD 180 1997-07-14 Zaire, Republic of |
| 136 |
.... |
| 137 |
|
| 138 |
For ISO 639-2, the first three columns are the alpha-3 code, the |
| 139 |
bibliographic code, and the alpha-2 code. The second and third columns |
| 140 |
may be empty. |
| 141 |
|
| 142 |
.... |
| 143 |
$ isoquery --iso=639-2 |
| 144 |
aar aa Afar |
| 145 |
abk ab Abkhazian |
| 146 |
ace Achinese |
| 147 |
[…] |
| 148 |
zun Zuni |
| 149 |
zxx No linguistic content; Not applicable |
| 150 |
zza Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki |
| 151 |
.... |
| 152 |
|
| 153 |
You can trim down the results by specifying only some codes. Moreover, |
| 154 |
the option to get translated names is also available. |
| 155 |
|
| 156 |
.... |
| 157 |
$ isoquery --iso=639-2 --locale=pt vi bo kl |
| 158 |
vie vi Vietnamita |
| 159 |
bod tib bo tibetano |
| 160 |
kal kl Kalaallisut; Greenlandic |
| 161 |
.... |
| 162 |
|
| 163 |
If you want to use ISO 639-3, the displayed columns are alpha-3, scope, type, |
| 164 |
alpha-2, bibliographic, and the language name. Both alpha-2 and bibliographic |
| 165 |
may be empty. |
| 166 |
|
| 167 |
.... |
| 168 |
$ isoquery -i 639-3 aal new spa guc |
| 169 |
aal I L Afade |
| 170 |
new I L Newari |
| 171 |
spa I L es Spanish |
| 172 |
guc I L Wayuu |
| 173 |
.... |
| 174 |
|
| 175 |
ISO 639-5 is also available. The displayed columns are alpha-3 and name. |
| 176 |
|
| 177 |
.... |
| 178 |
$ isoquery -i 639-5 aus tut |
| 179 |
aus Australian languages |
| 180 |
tut Altaic languages |
| 181 |
.... |
| 182 |
|
| 183 |
You can get selected translations of currency names from the ISO 4217 |
| 184 |
standard by using the following command. The first of the columns is |
| 185 |
the alpha-3 code, and the second one is the numerical code assigned |
| 186 |
to the currency. The name of the currency is shown in the third column. |
| 187 |
|
| 188 |
.... |
| 189 |
$ isoquery --iso=4217 --locale=da cad 392 |
| 190 |
CAD 124 Canadisk dollar |
| 191 |
JPY 392 Yen |
| 192 |
.... |
| 193 |
|
| 194 |
If you need to get script names, you can use the ISO 15924 table. |
| 195 |
The first of the columns is the alpha-4 code, and the second one is |
| 196 |
the numerical code assigned to the script. The name of the script |
| 197 |
is shown in the third column. |
| 198 |
|
| 199 |
.... |
| 200 |
$ isoquery --iso=15924 jpan latn 280 |
| 201 |
Jpan 413 Japanese (alias for Han + Hiragana + Katakana) |
| 202 |
Latn 215 Latin |
| 203 |
Visp 280 Visible Speech |
| 204 |
.... |
| 205 |
|
| 206 |
== Files |
| 207 |
|
| 208 |
By default, the JSON files provided by the *iso-codes* package will be used. |
| 209 |
|
| 210 |
* _/usr/share/iso-codes/json/iso_639-2.json_ |
| 211 |
* _/usr/share/iso-codes/json/iso_639-3.json_ |
| 212 |
* _/usr/share/iso-codes/json/iso_639-5.json_ |
| 213 |
* _/usr/share/iso-codes/json/iso_3166-1.json_ |
| 214 |
* _/usr/share/iso-codes/json/iso_3166-2.json_ |
| 215 |
* _/usr/share/iso-codes/json/iso_3166-3.json_ |
| 216 |
* _/usr/share/iso-codes/json/iso_4217.json_ |
| 217 |
* _/usr/share/iso-codes/json/iso_15924.json_ |
| 218 |
|
| 219 |
== Author |
| 220 |
|
| 221 |
Dr. Tobias Quathamer <[email protected]> |