Shell commands to paste from the clipboard

The clipboard is an easy way to transfer data into the command line from other tools. Use your system’s “paste from clipboard” command to pipe data into other commands for processing.
(See also my “copy to clipboard” post.)
On macOS, use pbpaste:
$ pbpaste | <command>
On Windows with PowerShell, use Get-Clipboard:
$ Get-Clipboard | <command>
If don’t use PowerShell, you can invoke it to run Get-Clipboard:
$ powershell.exe -noprofile -command Get-Clipboard | <command>
On Linux with Wayland (most distributions), use wl-paste:
$ wl-paste | <command>
On Linux with X11 (typically older distributions), use xclip:
$ xclip -o | <command>
😸😸😸 Check out my new book on using GitHub effectively, Boost Your GitHub DX! 😸😸😸
One summary email a week, no spam, I pinky promise.
Related posts: