Linux command
xclip 命令
网络
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Example
echo 123 | xclip
Example
echo 123 | xclip -selection clipboard
Example
xclip -selection clipboard input.txt
Example
xclip -selection clipboard -target image/png image.png
Example
xclip -i
Paste
xclip -o
Paste
xclip -o -selection clipboard
说明
xclip is an X11 clipboard manipulation tool. It can read data from standard input or files and write it to any X selection (primary, secondary, or clipboard), or output selection contents to stdout.
参数
- -i, -in
- Read from stdin or files (default mode)
- -o, -out
- Write selection to stdout
- -se, -selection SELECTION
- Specify selection: primary, secondary, or clipboard
- -t, -target TYPE
- Specify MIME target type (e.g., image/png, text/html)
- -d, -display DISPLAY
- X display to connect to
- -l, -loops N
- Number of paste requests to serve before exiting
- -f, -filter
- Print input to stdout while copying
- -q, -quiet
- Suppress informational output
- -v, -verbose
- Print extra information
- -silent
- Fork into background (used with -loops)
FAQ
What is the xclip command used for?
xclip is an X11 clipboard manipulation tool. It can read data from standard input or files and write it to any X selection (primary, secondary, or clipboard), or output selection contents to stdout.
How do I run a basic xclip example?
Run `echo 123 | xclip` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -i, -in do in xclip?
Read from stdin or files (default mode)