$linuxjunkies
>

wl-copy(1)

Copy text or files to the Wayland clipboard.

UbuntuDebianFedoraArch

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

FlagWhat it does
-c, --clearClear the clipboard instead of copying data
-p, --pasteOutput current clipboard contents (alias for wl-paste)
-t, --typeSpecify MIME type of data being copied (e.g., text/plain)
-f, --foregroundKeep the process running in foreground while clipboard is in use
-n, --no-newlineDo not add a trailing newline to stdin data
-h, --helpDisplay help message and exit
-v, --versionDisplay version information and exit

Examples

Copy simple text to clipboard from echo output

echo 'Hello, World!' | wl-copy

Copy entire file contents to clipboard using input redirection

wl-copy < /path/to/file.txt

Copy file contents using cat and pipe to clipboard

cat config.sh | wl-copy

Copy text passed directly as command argument

wl-copy 'Direct text argument'

Copy output of ls command directly to clipboard

ls -la | wl-copy

Copy specific git file version to clipboard

git show HEAD:file.txt | wl-copy

Clear the clipboard completely

wl-copy --clear

Copy current directory path and immediately verify with wl-paste

pwd | wl-copy && wl-paste

Related commands