wl-copy(1)
Copy text or files to the Wayland clipboard.
Synopsis
wl-copy [OPTION]... [TEXT]Description
wl-copy copies text or file contents to the Wayland clipboard. It reads from stdin or accepts text as command arguments, making it a Wayland equivalent to xclip for X11 systems. The data remains in the clipboard until another application copies new content.
If no text is provided as arguments, wl-copy reads from standard input. This allows piping output directly into the clipboard from other commands.
Common options
| Flag | What it does |
|---|---|
-c, --clear | Clear the clipboard instead of copying data |
-p, --paste | Output current clipboard contents (alias for wl-paste) |
-t, --type | Specify MIME type of data being copied (e.g., text/plain) |
-f, --foreground | Keep the process running in foreground while clipboard is in use |
-n, --no-newline | Do not add a trailing newline to stdin data |
-h, --help | Display help message and exit |
-v, --version | Display version information and exit |
Examples
Copy simple text to clipboard from echo output
echo 'Hello, World!' | wl-copyCopy entire file contents to clipboard using input redirection
wl-copy < /path/to/file.txtCopy file contents using cat and pipe to clipboard
cat config.sh | wl-copyCopy text passed directly as command argument
wl-copy 'Direct text argument'Copy output of ls command directly to clipboard
ls -la | wl-copyCopy specific git file version to clipboard
git show HEAD:file.txt | wl-copyClear the clipboard completely
wl-copy --clearCopy current directory path and immediately verify with wl-paste
pwd | wl-copy && wl-paste