aboutsummaryrefslogtreecommitdiff
path: root/doc/man/gnunet-search.1
diff options
context:
space:
mode:
Diffstat (limited to 'doc/man/gnunet-search.1')
-rw-r--r--doc/man/gnunet-search.1313
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:
63Given 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. 68Given 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.
64The time-period is twice the average delay by which GNUnet artificially delays traffic. 69The time-period is twice the average delay by which GNUnet artificially delays traffic.
65Note that regardless of the anonymity level you choose, peers that cache content in the network always use anonymity level 1. 70Note 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
72Do 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
67Use the configuration file 74Use 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
80Write 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
84argument (please refer to it for more information). If missing,
85.Fl -dir-printf
86defaults to
87.Fl -printf Ns
88\&. If
89.Fl -printf
90is missing too
91.Fl -dir-printf
92defaults 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
96Write the search results according to
97.Ar FORMAT Ns
98, in which
99.Ql \e
100and
101.Ql %
102directives are interpreted as follows:
103.Bl -tag -width indent
104.It Li \e\e
105a literal backslash
106.No ( Ql \e Ns )
107.It Li \ea
108an alarm bell
109.It Li \eb
110a backspace
111.It Li \ee
112an escape
113.It Li \ef
114a form feed
115.It Li \en
116a newline
117.It Li \er
118a carriage return
119.It Li \et
120a horizontal tab
121.It Li \ev
122a vertical tab
123.It Li \e0
124an ASCII NUL.
125.It Li \eN...
126the character whose ASCII code is N..., expressed in octal digits
127.It Li \exX...
128the character whose ASCII code is X..., expressed in hexadecimal digits
129.Pp
130.El
131.Sy Note:
132The
133.Ql \e
134character 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 %%
137a percent sign
138.It Li %a
139the complete list of all the printable metadata properties available, displayed according to the
140.Fl -iter-printf
141argument; this specifier optionally supports metatype filtering via hash sign
142.No (e.g.
143.Ql %2#a
144prints all embedded file names, if present - see libextractor's metatypes for the complete list of numerical identifiers)
145.It Li %f
146the file's name
147.It Li %j
148the first printable metadata property available, displayed according to the
149.Fl -iter-printf
150argument; this specifier optionally supports metatype filtering via hash sign
151.No (e.g.
152.Ql %5#j
153prints a book title, if present); see libextractor's metatypes for the complete list of numerical identifiers)
154.It Li %l
155the file name's length
156.It Li %m
157the file's mime type
158.It Li %n
159the search result number
160.It Li %s
161the file's size in bytes
162.It Li %u
163the file's URI
164.El
165.Pp
166.Sy Note:
167The
168.Ql %
169character followed by any other character not listed above is treated as an ordinary character, so both characters are printed.
170.Pp
171If missing,
172.Fl -printf
173defaults 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
72Print the help page. 177Print the help page.
178.It Fl i Ar FORMAT | Fl -iter-printf= Ns Ar FORMAT
179When the
180.Ql %a
181or
182.Ql %j
183format specifiers appear in
184.Fl -printf
185or
186.Fl -dir-printf Ns
187, list each metadata property according to
188.Ar FORMAT Ns
189, in which the
190.Ql \e
191directives are interpreted as in
192.Fl -printf
193and
194.Fl -dir-printf Ns
195, while the
196.Ql %
197directives are interpreted as follows:
198.Bl -tag -width indent
199.It Li %%
200a percent sign
201.It Li %p
202the property's content
203.It Li %l
204the property content's length in bytes
205.It Li %i
206the property type's unique identifier
207.It Li %n
208the property number
209.It Li %t
210the property type (available only if compiled with libextractor)
211.It Li %w
212the name of the plugin that provided the information
213.El
214.Pp
215.Sy Note:
216The
217.Ql %
218character followed by any other character not listed above is treated as an ordinary character, so both characters are printed.
219.Pp
220If missing,
221.Fl -iter-printf
222defaults to
223.Ql \& \& %t: %p\en
224or
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
74Change the loglevel. 228Change the loglevel.
75Possible values for LOGLEVEL are ERROR, WARNING, INFO and DEBUG. 229Possible values for
230.Ar LOGLEVEL
231are 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
77Write logs to 233Write 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
80Writes a GNUnet directory containing all of the search results to 236Writes 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
83Only search locally, do not forward requests to other peers. 242Only 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
85Automatically terminate the search after receiving 244Automatically terminate the search after receiving
86.Ar VALUE 245.Ar VALUE
87results. 246results.
247.It Fl s | -silent
248Enable silent mode and do not print any result (the
249.Fl -output
250argument is required).
88.It Fl t Ar DELAY | Fl -timeout= Ns Ar DELAY 251.It Fl t Ar DELAY | Fl -timeout= Ns Ar DELAY
89Automatically timeout search after 252Automatically timeout search after
90.Ar DELAY . 253.Ar DELAY .
91The value given must be a number followed by a space and a time unit, for example "500 ms". 254The value given must be a number followed by a space and a time unit, for example
92Note 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).
93Otherwise the search runs until gnunet-search is aborted with CTRL-C. 256If 0 or omitted the search runs until gnunet-search is aborted with CTRL-C.
94.It Fl v | -version 257.It Fl v | -version
95print the version number 258print the version number
96.It Fl V | -verbose 259.It Fl V | -verbose
97print meta data from search results as well 260append
261.Ql %a\en
262to the default
263.Fl -printf
264and
265.Fl -dir-printf
266arguments \[u2013] ignored when these are provided by the user
98.El 267.El
99You can run gnunet-search with an URI instead of a keyword. 268.Pp
269It is possible to run
270.Nm gnunet-search
271with an URI instead of a keyword.
100The URI can have the format for a namespace search or for a keyword search. 272The URI can have the format for a namespace search or for a keyword search.
101For a namespace search, the format is 273For a namespace search, the format is
102.Pp 274.Pp
@@ -108,46 +280,137 @@ For a keyword search, use
108.Pp 280.Pp
109If the format does not correspond to a GNUnet URI, GNUnet will automatically assume that keywords are supplied directly. 281If the format does not correspond to a GNUnet URI, GNUnet will automatically assume that keywords are supplied directly.
110.sp 282.sp
111If multiple keywords are passed, gnunet-search will look for content matching any of the keywords. 283If multiple keywords are passed,
112The prefix "+" makes a keyword mandatory. 284.Nm gnunet-search
285will look for content matching any of the keywords.
286The
287.Ql +
288prefix makes a keyword mandatory.
113.Sh FILES 289.Sh FILES
114.Pa ~/.config/gnunet.conf 290.Pa ~/.config/gnunet.conf
115GNUnet configuration file; specifies the default value for the timeout 291GNUnet configuration file; specifies the default value for the timeout
116.Sh EXAMPLES 292.Sh EXAMPLES
117.Dl $ gnunet-search "Das Kapital" 293Example 1:
294.Pp
295.Dl $ gnunet-search 'Das Kapital'
118.Pp 296.Pp
119Searches for content matching the keyword "Das Kapital". 297searches for content matching the keyword
298.Dq Das Kapital Ns
299.
300.Pp
301Example 2:
302.Pp
303.Dl $ gnunet-search Das Kapital
304.Pp
305searches for content matching either keyword
306.Dq Das
307or keyword
308.Dq Kapital Ns
309.
310.Pp
311Example 3:
120.Pp 312.Pp
121.Dl $ gnunet-search +Das +Kapital 313.Dl $ gnunet-search +Das +Kapital
122.Pp 314.Pp
123Searches for content matching both mandatory keywords "Das" and "Kapital". 315searches for content matching both mandatory keywords
316.Dq Das
317and
318.Dq Kapital Ns
319.
124.sp 320.sp
125Search results are printed by gnunet-search like this: 321Search results are printed by
322.Nm gnunet-search
323like 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
133The first line contains the command to run to download the file. 333The first line contains the command to run to download the file.
134The suggested filename in the example is COPYING. 334The suggested filename in the example is
135The GNUnet URI consists of the key and query hash of the file and finally the size of the file. 335.Ql COPYING Ns
136After 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.
137The meta-data here is the description ("The GNU General Public License") and the mime-type ("text-plain"). 337If the
338.Fl -verbose
339option was provided, after the command to download the file, GNUnet will print metadata about the file as advertised in the search result.
340The 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).
138See the options for 347See the options for
139.Xr gnunet-publish 1 348.Xr gnunet-publish 1
140on how to supply meta-data by hand. 349on how to supply metadata by hand.
350.Pp
351The
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
365Example 4:
366.Pp
367.ad l
368 $ gnunet-search -f '%f (%s bytes)\en' commons
369.Pp
370will print a simple list of the results that match the
371.Dq commons
372keyword, with only the file name and the size printed, without any URI. Or, for instance,
373.Pp
374Example 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
399will 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
403keyword 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
147The full documentation for gnunet is maintained as a Texinfo manual. 410The full documentation for GNUnet is maintained as a Texinfo manual.
148If the 411If the
149.Xr info 1 412.Xr info 1
150and gnunet programs are properly installed at your site, the command 413and 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