TOOL » LINUX » X_SERVER

Xclip

Usage

shell
xclip OPTION FILE
OptionDescription
-i -inRead from stdin into X selection (default).
-o -outPrint the selection to stdout.
-selectionSpecify which X selection to use: primary secondary or clipboard.
-f -filterPrint the text piped back to stdout.

Examples

In bash:

bash
echo -n $(pwd) | xclip -sel clip
xclip -sel clip -o | jq . | xclip -sel clip

In fish:

fish
echo -n (string replace --regex "^$HOME" \~ $PWD) | xclip -selection clipboard