diff options
Diffstat (limited to 'doc/man/gnunet-search.1')
-rw-r--r-- | doc/man/gnunet-search.1 | 313 |
1 files changed, 288 insertions, 25 deletions
diff --git a/doc/man/gnunet-search.1 b/doc/man/gnunet-search.1 index 4ec5189de..3145842a4 100644 --- a/doc/man/gnunet-search.1 +++ b/doc/man/gnunet-search.1 | |||
@@ -21,7 +21,7 @@ | |||
21 | .\" | 21 | .\" |
22 | .\" SPDX-License-Identifier: GPL3.0-or-later OR FDL1.3-or-later | 22 | .\" SPDX-License-Identifier: GPL3.0-or-later OR FDL1.3-or-later |
23 | .\" | 23 | .\" |
24 | .Dd February 25, 2012 | 24 | .Dd February 12, 2022 |
25 | .Dt GNUNET-SEARCH 1 | 25 | .Dt GNUNET-SEARCH 1 |
26 | .Os | 26 | .Os |
27 | .Sh NAME | 27 | .Sh NAME |
@@ -30,13 +30,18 @@ | |||
30 | .Sh SYNOPSIS | 30 | .Sh SYNOPSIS |
31 | .Nm | 31 | .Nm |
32 | .Op Fl a Ar LEVEL | Fl -anonymity= Ns Ar LEVEL | 32 | .Op Fl a Ar LEVEL | Fl -anonymity= Ns Ar LEVEL |
33 | .Op Fl b | -bookmark-only | ||
33 | .Op Fl c Ar FILENAME | Fl -config= Ns Ar FILENAME | 34 | .Op Fl c Ar FILENAME | Fl -config= Ns Ar FILENAME |
35 | .Op Fl F Ar FORMAT | Fl -dir-printf= Ns Ar FORMAT | ||
36 | .Op Fl f Ar FORMAT | Fl -printf= Ns Ar FORMAT | ||
34 | .Op Fl h | -help | 37 | .Op Fl h | -help |
38 | .Op Fl i Ar FORMAT | Fl -iter-printf= Ns Ar FORMAT | ||
35 | .Op Fl L Ar LOGLEVEL | Fl -loglevel= Ns Ar LOGLEVEL | 39 | .Op Fl L Ar LOGLEVEL | Fl -loglevel= Ns Ar LOGLEVEL |
36 | .Op Fl l Ar FILENAME | Fl -logfile= Ns Ar FILENAME | 40 | .Op Fl l Ar FILENAME | Fl -logfile= Ns Ar FILENAME |
37 | .Op Fl o Ar FILENAME | Fl -output= Ns Ar FILENAME | 41 | .Op Fl o Ar FILENAME | Fl -output= Ns Ar FILENAME |
38 | .Op Fl n | -no-network | 42 | .Op Fl n | -no-network |
39 | .Op Fl N Ar VALUE | Fl -results= Ns Ar VALUE | 43 | .Op Fl N Ar VALUE | Fl -results= Ns Ar VALUE |
44 | .Op Fl s | -silent | ||
40 | .Op Fl t Ar DELAY | Fl -timeout= Ns Ar DELAY | 45 | .Op Fl t Ar DELAY | Fl -timeout= Ns Ar DELAY |
41 | .Op Fl v | -version | 46 | .Op Fl v | -version |
42 | .Op Fl V | -verbose | 47 | .Op Fl V | -verbose |
@@ -63,40 +68,207 @@ The specific numeric value (for anonymity levels above 1) is simple: | |||
63 | Given an anonymity level L (above 1), each request FS makes on your behalf must be hidden in L-1 equivalent requests of cover traffic (traffic your peer routes for others) in the same time-period. | 68 | Given an anonymity level L (above 1), each request FS makes on your behalf must be hidden in L-1 equivalent requests of cover traffic (traffic your peer routes for others) in the same time-period. |
64 | The time-period is twice the average delay by which GNUnet artificially delays traffic. | 69 | The time-period is twice the average delay by which GNUnet artificially delays traffic. |
65 | Note that regardless of the anonymity level you choose, peers that cache content in the network always use anonymity level 1. | 70 | Note that regardless of the anonymity level you choose, peers that cache content in the network always use anonymity level 1. |
71 | .It Fl b | -bookmark-only | ||
72 | Do not search, print only the URI that points to the search with the given keywords. | ||
66 | .It Fl c Ar FILENAME | Fl -config= Ns Ar FILENAME | 73 | .It Fl c Ar FILENAME | Fl -config= Ns Ar FILENAME |
67 | Use the configuration file | 74 | Use the configuration file |
68 | .Ar FILENAME | 75 | .Ar FILENAME |
69 | (default: | 76 | (default: |
70 | .Pa ~/.config/gnunet.conf ) | 77 | .Pa ~/.config/gnunet.conf Ns |
78 | ). | ||
79 | .It Fl F Ar FORMAT | Fl -dir-printf= Ns Ar FORMAT | ||
80 | Write the search results for directories according to | ||
81 | .Ar FORMAT Ns | ||
82 | \&. The directives supported here are identical to those supported in the | ||
83 | .Fl -printf | ||
84 | argument (please refer to it for more information). If missing, | ||
85 | .Fl -dir-printf | ||
86 | defaults to | ||
87 | .Fl -printf Ns | ||
88 | \&. If | ||
89 | .Fl -printf | ||
90 | is missing too | ||
91 | .Fl -dir-printf | ||
92 | defaults to | ||
93 | .Ql #%n:\engnunet-download -o Qo %f Qc -R %u\en\en Ns | ||
94 | \&. | ||
95 | .It Fl f Ar FORMAT | Fl -printf= Ns Ar FORMAT | ||
96 | Write the search results according to | ||
97 | .Ar FORMAT Ns | ||
98 | , in which | ||
99 | .Ql \e | ||
100 | and | ||
101 | .Ql % | ||
102 | directives are interpreted as follows: | ||
103 | .Bl -tag -width indent | ||
104 | .It Li \e\e | ||
105 | a literal backslash | ||
106 | .No ( Ql \e Ns ) | ||
107 | .It Li \ea | ||
108 | an alarm bell | ||
109 | .It Li \eb | ||
110 | a backspace | ||
111 | .It Li \ee | ||
112 | an escape | ||
113 | .It Li \ef | ||
114 | a form feed | ||
115 | .It Li \en | ||
116 | a newline | ||
117 | .It Li \er | ||
118 | a carriage return | ||
119 | .It Li \et | ||
120 | a horizontal tab | ||
121 | .It Li \ev | ||
122 | a vertical tab | ||
123 | .It Li \e0 | ||
124 | an ASCII NUL. | ||
125 | .It Li \eN... | ||
126 | the character whose ASCII code is N..., expressed in octal digits | ||
127 | .It Li \exX... | ||
128 | the character whose ASCII code is X..., expressed in hexadecimal digits | ||
129 | .Pp | ||
130 | .El | ||
131 | .Sy Note: | ||
132 | The | ||
133 | .Ql \e | ||
134 | character followed by any other character not listed above is treated as an ordinary character, so both characters are printed. | ||
135 | .Bl -tag -width indent | ||
136 | .It Li %% | ||
137 | a percent sign | ||
138 | .It Li %a | ||
139 | the complete list of all the printable metadata properties available, displayed according to the | ||
140 | .Fl -iter-printf | ||
141 | argument; this specifier optionally supports metatype filtering via hash sign | ||
142 | .No (e.g. | ||
143 | .Ql %2#a | ||
144 | prints all embedded file names, if present - see libextractor's metatypes for the complete list of numerical identifiers) | ||
145 | .It Li %f | ||
146 | the file's name | ||
147 | .It Li %j | ||
148 | the first printable metadata property available, displayed according to the | ||
149 | .Fl -iter-printf | ||
150 | argument; this specifier optionally supports metatype filtering via hash sign | ||
151 | .No (e.g. | ||
152 | .Ql %5#j | ||
153 | prints a book title, if present); see libextractor's metatypes for the complete list of numerical identifiers) | ||
154 | .It Li %l | ||
155 | the file name's length | ||
156 | .It Li %m | ||
157 | the file's mime type | ||
158 | .It Li %n | ||
159 | the search result number | ||
160 | .It Li %s | ||
161 | the file's size in bytes | ||
162 | .It Li %u | ||
163 | the file's URI | ||
164 | .El | ||
165 | .Pp | ||
166 | .Sy Note: | ||
167 | The | ||
168 | .Ql % | ||
169 | character followed by any other character not listed above is treated as an ordinary character, so both characters are printed. | ||
170 | .Pp | ||
171 | If missing, | ||
172 | .Fl -printf | ||
173 | defaults to | ||
174 | .Ql #%n:\engnunet-download -o Qo %f Qc %u\en\en Ns | ||
175 | \&. | ||
71 | .It Fl h | -help | 176 | .It Fl h | -help |
72 | Print the help page. | 177 | Print the help page. |
178 | .It Fl i Ar FORMAT | Fl -iter-printf= Ns Ar FORMAT | ||
179 | When the | ||
180 | .Ql %a | ||
181 | or | ||
182 | .Ql %j | ||
183 | format specifiers appear in | ||
184 | .Fl -printf | ||
185 | or | ||
186 | .Fl -dir-printf Ns | ||
187 | , list each metadata property according to | ||
188 | .Ar FORMAT Ns | ||
189 | , in which the | ||
190 | .Ql \e | ||
191 | directives are interpreted as in | ||
192 | .Fl -printf | ||
193 | and | ||
194 | .Fl -dir-printf Ns | ||
195 | , while the | ||
196 | .Ql % | ||
197 | directives are interpreted as follows: | ||
198 | .Bl -tag -width indent | ||
199 | .It Li %% | ||
200 | a percent sign | ||
201 | .It Li %p | ||
202 | the property's content | ||
203 | .It Li %l | ||
204 | the property content's length in bytes | ||
205 | .It Li %i | ||
206 | the property type's unique identifier | ||
207 | .It Li %n | ||
208 | the property number | ||
209 | .It Li %t | ||
210 | the property type (available only if compiled with libextractor) | ||
211 | .It Li %w | ||
212 | the name of the plugin that provided the information | ||
213 | .El | ||
214 | .Pp | ||
215 | .Sy Note: | ||
216 | The | ||
217 | .Ql % | ||
218 | character followed by any other character not listed above is treated as an ordinary character, so both characters are printed. | ||
219 | .Pp | ||
220 | If missing, | ||
221 | .Fl -iter-printf | ||
222 | defaults to | ||
223 | .Ql \& \& %t: %p\en | ||
224 | or | ||
225 | .Ql \& \& MetaType #%i: %p\en Ns | ||
226 | , depending on whether the program was compiled with libextractor or not. | ||
73 | .It Fl L Ar LOGLEVEL | Fl -loglevel= Ns Ar LOGLEVEL | 227 | .It Fl L Ar LOGLEVEL | Fl -loglevel= Ns Ar LOGLEVEL |
74 | Change the loglevel. | 228 | Change the loglevel. |
75 | Possible values for LOGLEVEL are ERROR, WARNING, INFO and DEBUG. | 229 | Possible values for |
230 | .Ar LOGLEVEL | ||
231 | are ERROR, WARNING, INFO and DEBUG. | ||
76 | .It Fl l Ar FILENAME | Fl -logfile= Ns Ar FILENAME | 232 | .It Fl l Ar FILENAME | Fl -logfile= Ns Ar FILENAME |
77 | Write logs to | 233 | Write logs to |
78 | .Ar FILENAME . | 234 | .Ar FILENAME . |
79 | .It Fl o Ar FILENAME | Fl -output= Ns Ar FILENAME | 235 | .It Fl o Ar FILENAME | Fl -output= Ns Ar FILENAME |
80 | Writes a GNUnet directory containing all of the search results to | 236 | Writes a GNUnet directory containing all of the search results to |
81 | .Ar FILENAME . | 237 | .Ar FILENAME |
238 | .No (e.g. | ||
239 | .Ql gnunet-search --output=commons.gnd commons Ns | ||
240 | ). | ||
82 | .It Fl n | -no-network | 241 | .It Fl n | -no-network |
83 | Only search locally, do not forward requests to other peers. | 242 | Only search locally, do not forward requests to other peers. |
84 | .It Fl N Ar VALUE | Fl -results= Ns Ar VALUE | 243 | .It Fl N Ar VALUE | Fl -results= Ns Ar VALUE |
85 | Automatically terminate the search after receiving | 244 | Automatically terminate the search after receiving |
86 | .Ar VALUE | 245 | .Ar VALUE |
87 | results. | 246 | results. |
247 | .It Fl s | -silent | ||
248 | Enable silent mode and do not print any result (the | ||
249 | .Fl -output | ||
250 | argument is required). | ||
88 | .It Fl t Ar DELAY | Fl -timeout= Ns Ar DELAY | 251 | .It Fl t Ar DELAY | Fl -timeout= Ns Ar DELAY |
89 | Automatically timeout search after | 252 | Automatically timeout search after |
90 | .Ar DELAY . | 253 | .Ar DELAY . |
91 | The value given must be a number followed by a space and a time unit, for example "500 ms". | 254 | The value given must be a number followed by a space and a time unit, for example |
92 | Note that the quotes are required on the shell. | 255 | .Qo 500 ms Qc . Note that the quotes are required on the shell. Without a unit it defaults to microseconds (1000000 = 1 second). |
93 | Otherwise the search runs until gnunet-search is aborted with CTRL-C. | 256 | If 0 or omitted the search runs until gnunet-search is aborted with CTRL-C. |
94 | .It Fl v | -version | 257 | .It Fl v | -version |
95 | print the version number | 258 | print the version number |
96 | .It Fl V | -verbose | 259 | .It Fl V | -verbose |
97 | print meta data from search results as well | 260 | append |
261 | .Ql %a\en | ||
262 | to the default | ||
263 | .Fl -printf | ||
264 | and | ||
265 | .Fl -dir-printf | ||
266 | arguments \[u2013] ignored when these are provided by the user | ||
98 | .El | 267 | .El |
99 | You can run gnunet-search with an URI instead of a keyword. | 268 | .Pp |
269 | It is possible to run | ||
270 | .Nm gnunet-search | ||
271 | with an URI instead of a keyword. | ||
100 | The URI can have the format for a namespace search or for a keyword search. | 272 | The URI can have the format for a namespace search or for a keyword search. |
101 | For a namespace search, the format is | 273 | For a namespace search, the format is |
102 | .Pp | 274 | .Pp |
@@ -108,46 +280,137 @@ For a keyword search, use | |||
108 | .Pp | 280 | .Pp |
109 | If the format does not correspond to a GNUnet URI, GNUnet will automatically assume that keywords are supplied directly. | 281 | If the format does not correspond to a GNUnet URI, GNUnet will automatically assume that keywords are supplied directly. |
110 | .sp | 282 | .sp |
111 | If multiple keywords are passed, gnunet-search will look for content matching any of the keywords. | 283 | If multiple keywords are passed, |
112 | The prefix "+" makes a keyword mandatory. | 284 | .Nm gnunet-search |
285 | will look for content matching any of the keywords. | ||
286 | The | ||
287 | .Ql + | ||
288 | prefix makes a keyword mandatory. | ||
113 | .Sh FILES | 289 | .Sh FILES |
114 | .Pa ~/.config/gnunet.conf | 290 | .Pa ~/.config/gnunet.conf |
115 | GNUnet configuration file; specifies the default value for the timeout | 291 | GNUnet configuration file; specifies the default value for the timeout |
116 | .Sh EXAMPLES | 292 | .Sh EXAMPLES |
117 | .Dl $ gnunet-search "Das Kapital" | 293 | Example 1: |
294 | .Pp | ||
295 | .Dl $ gnunet-search 'Das Kapital' | ||
118 | .Pp | 296 | .Pp |
119 | Searches for content matching the keyword "Das Kapital". | 297 | searches for content matching the keyword |
298 | .Dq Das Kapital Ns | ||
299 | . | ||
300 | .Pp | ||
301 | Example 2: | ||
302 | .Pp | ||
303 | .Dl $ gnunet-search Das Kapital | ||
304 | .Pp | ||
305 | searches for content matching either keyword | ||
306 | .Dq Das | ||
307 | or keyword | ||
308 | .Dq Kapital Ns | ||
309 | . | ||
310 | .Pp | ||
311 | Example 3: | ||
120 | .Pp | 312 | .Pp |
121 | .Dl $ gnunet-search +Das +Kapital | 313 | .Dl $ gnunet-search +Das +Kapital |
122 | .Pp | 314 | .Pp |
123 | Searches for content matching both mandatory keywords "Das" and "Kapital". | 315 | searches for content matching both mandatory keywords |
316 | .Dq Das | ||
317 | and | ||
318 | .Dq Kapital Ns | ||
319 | . | ||
124 | .sp | 320 | .sp |
125 | Search results are printed by gnunet-search like this: | 321 | Search results are printed by |
322 | .Nm gnunet-search | ||
323 | like this: | ||
126 | .Pp | 324 | .Pp |
127 | .ad l | 325 | .ad l |
128 | gnunet-download -o "COPYING" gnunet://fs/chk/HASH1.HASH2.SIZE | 326 | gnunet-download -o "COPYING" gnunet://fs/chk/HASH1.HASH2.SIZE |
129 | Description: The GNU General Public License | 327 | .Pp |
130 | Mime-type: text/plain | 328 | Description: The GNU General Public License |
329 | Mime-type: text/plain | ||
330 | ... | ||
131 | .ad b | 331 | .ad b |
132 | 332 | .Pp | |
133 | The first line contains the command to run to download the file. | 333 | The first line contains the command to run to download the file. |
134 | The suggested filename in the example is COPYING. | 334 | The suggested filename in the example is |
135 | The GNUnet URI consists of the key and query hash of the file and finally the size of the file. | 335 | .Ql COPYING Ns |
136 | After the command to download the file, GNUnet will print meta-data about the file as advertised in the search result. | 336 | \&. The GNUnet URI consists of the key and query hash of the file and finally the size of the file. |
137 | The meta-data here is the description ("The GNU General Public License") and the mime-type ("text-plain"). | 337 | If the |
338 | .Fl -verbose | ||
339 | option was provided, after the command to download the file, GNUnet will print metadata about the file as advertised in the search result. | ||
340 | The metadata here is the description | ||
341 | .No ( Ns | ||
342 | .Dq The GNU General Public License Ns | ||
343 | ) and the mime-type | ||
344 | .No ( Ns | ||
345 | .Dq text-plain Ns | ||
346 | ). | ||
138 | See the options for | 347 | See the options for |
139 | .Xr gnunet-publish 1 | 348 | .Xr gnunet-publish 1 |
140 | on how to supply meta-data by hand. | 349 | on how to supply metadata by hand. |
350 | .Pp | ||
351 | The | ||
352 | .Fl -printf | ||
353 | .No ( Ns | ||
354 | .Fl f Ns | ||
355 | ), | ||
356 | .Fl -dir-printf | ||
357 | .No ( Ns | ||
358 | .Fl F Ns | ||
359 | ) and | ||
360 | .Fl -iter-printf | ||
361 | .No ( Ns | ||
362 | .Fl i Ns | ||
363 | ) arguments offer powerful tools for manipulating the output printed. For instance, | ||
364 | .Pp | ||
365 | Example 4: | ||
366 | .Pp | ||
367 | .ad l | ||
368 | $ gnunet-search -f '%f (%s bytes)\en' commons | ||
369 | .Pp | ||
370 | will print a simple list of the results that match the | ||
371 | .Dq commons | ||
372 | keyword, with only the file name and the size printed, without any URI. Or, for instance, | ||
373 | .Pp | ||
374 | Example 5: | ||
375 | .Pp | ||
376 | .ad l | ||
377 | #!/bin/sh | ||
378 | { | ||
379 | printf '<list>' | ||
380 | gnunet-search -f ' | ||
381 | <file uri="%u"> | ||
382 | <filename len="%l">%f</filename> | ||
383 | <size>%s</size> | ||
384 | <mimetype>%m</mimetype> | ||
385 | <result_id>%n</result_id> | ||
386 | <metadata>%a | ||
387 | </metadata> | ||
388 | </file>' \e | ||
389 | -i ' | ||
390 | <property tid="%i" type="%t"> | ||
391 | <content len="%l">%p</content> | ||
392 | <property_id>%n</property_id> | ||
393 | <provided_by>%w</provided_by> | ||
394 | </property>' \e | ||
395 | -t '2 s' commons | ||
396 | printf '\en</list>\en' | ||
397 | } > commons.xml | ||
398 | .Pp | ||
399 | will run for two seconds and then create a file named | ||
400 | .Pa commons.xml Ns | ||
401 | , containing the search results that match the | ||
402 | .Dq commons | ||
403 | keyword in XML format. | ||
141 | .Sh SEE ALSO | 404 | .Sh SEE ALSO |
142 | .Xr gnunet-download 1 , | 405 | .Xr gnunet-download 1 , |
143 | .Xr gnunet-fs-gtk 1 , | 406 | .Xr gnunet-fs-gtk 1 , |
144 | .Xr gnunet-publish 1 , | 407 | .Xr gnunet-publish 1 , |
145 | .Xr gnunet.conf 5 | 408 | .Xr gnunet.conf 5 |
146 | .sp | 409 | .sp |
147 | The full documentation for gnunet is maintained as a Texinfo manual. | 410 | The full documentation for GNUnet is maintained as a Texinfo manual. |
148 | If the | 411 | If the |
149 | .Xr info 1 | 412 | .Xr info 1 |
150 | and gnunet programs are properly installed at your site, the command | 413 | and gnunet packages are properly installed at your site, the command |
151 | .Pp | 414 | .Pp |
152 | .Dl info gnunet | 415 | .Dl info gnunet |
153 | .Pp | 416 | .Pp |