1XCLIP(1) General Commands Manual XCLIP(1)
2
3
4
6 xclip - command line interface to X selections (clipboard)
7
9 xclip [OPTION] [FILE]...
10
12 Reads from standard in, or from one or more files, and makes the data
13 available as an X selection for pasting into X applications. Prints
14 current X selection to standard out.
15
16 -i, -in
17 read text into X selection from standard input or files
18 (default)
19
20 -o, -out
21 print the selection to standard out (generally for piping to a
22 file or program)
23
24 -f, -filter
25 when xclip is invoked in the in mode with output level set to
26 silent (the defaults), the filter option will cause xclip to
27 print the text piped to standard in back to standard out unmodi‐
28 fied
29
30 -r, -rmlastnl
31 when the last character of the selection is a newline character,
32 remove it. Newline characters that are not the last character in
33 the selection are not affected. If the selection does not end
34 with a newline character, this option has no effect. This option
35 is useful for copying one-line output of programs like pwd to
36 the clipboard to paste it again into the command prompt without
37 executing the line immideately due to the newline character pwd
38 appends.
39
40 -l, -loops
41 number of X selection requests (pastes into X applications) to
42 wait for before exiting, with a value of 0 (default) causing
43 xclip to wait for an unlimited number of requests until another
44 application (possibly another invocation of xclip) takes owner‐
45 ship of the selection
46
47 -t, -target
48 specify a particular data format using the given target atom.
49 With -o the special target atom name "TARGETS" can be used to
50 get a list of valid target atoms for this selection. For more
51 information about target atoms refer to ICCCM section 2.6.2
52
53 -d, -display
54 X display to use (e.g. "localhost:0"), xclip defaults to the
55 value in $DISPLAY if this option is omitted
56
57 -h, -help
58 show quick summary of options
59
60 -selection
61 specify which X selection to use, options are "primary" to use
62 XA_PRIMARY (default), "secondary" for XA_SECONDARY or "clip‐
63 board" for XA_CLIPBOARD
64
65 -version
66 show version information
67
68 -silent
69 fork into the background to wait for requests, no informational
70 output, errors only (default)
71
72 -quiet show informational messages on the terminal and run in the fore‐
73 ground
74
75 -verbose
76 provide a running commentary of what xclip is doing
77
78 -noutf8
79 operate in legacy (i.e. non UTF-8) mode for backwards compati‐
80 bility (Use this option only when really necessary, as the old
81 behavior was broken)
82
83
84 xclip reads text from standard in or files and makes it available to
85 other X applications for pasting as an X selection (traditionally with
86 the middle mouse button). It reads from all files specified, or from
87 standard in if no files are specified. xclip can also print the con‐
88 tents of a selection to standard out with the -o option.
89
90 xclip was designed to allow tighter integration of X applications and
91 command line programs. The default action is to silently wait in the
92 background for X selection requests (pastes) until another X applica‐
93 tion places data in the clipboard, at which point xclip exits silently.
94 You can use the -verbose option to see if and when xclip actually
95 receives selection requests from other X applications.
96
97 Options can be abbreviated as long as they remain unambiguous. For
98 example, it is possible to use -d or -disp instead of -display. How‐
99 ever, -v couldn't be used because it is ambiguous (it could be short
100 for -verbose or -version), so it would be interpreted as a filename.
101
102 Note that only the first character of the selection specified with the
103 -selection option is important. This means that "p", "sec" and "clip"
104 would have the same effect as using "primary", "secondary" or "clip‐
105 board" respectively.
106
107
109 I hate man pages without examples!
110
111 uptime | xclip
112
113 Put your uptime in the X selection. Then middle click in an X applica‐
114 tion to paste.
115
116 xclip -loops 10 -verbose /etc/motd
117
118 Exit after /etc/motd (message of the day) has been pasted 10 times.
119 Show how many selection requests (pastes) have been processed.
120
121 xclip -o > helloworld.c
122
123 Put the contents of the selection into a file.
124
125 xclip -t text/html index.html
126
127 Middle click in an X application supporting HTML to paste the contents
128 of the given file as HTML.
129
130
132 DISPLAY
133 X display to use if none is specified with the -display option.
134
135
137 Please report any bugs, problems, queries, experiences, etc. directly
138 to the author.
139
140
142 Kim Saunders <kims@debian.org> Peter Åstrand <astrand@lysator.liu.se>
143
144
145
146 XCLIP(1)