← All commands
Topic hub Text Processing
Windows Linux Text Processing Expanded guide

Windows clip / clip.exe equivalent in Linux

Pipes command output directly into the clipboard so you can paste it elsewhere.

Windows clip / clip.exe
→
Linux equivalents
Debian/Ubuntu same command
xclip / xsel
Fedora same command
xclip / xsel
Arch same command
xclip / xsel

Overview

What this command does

On Windows, "clip / clip.exe" is used to copy output to clipboard. On Linux, the closest practical mapping shown here is "xclip / xsel". Pipes command output directly into the clipboard so you can paste it elsewhere. This reference is grouped under Text Processing.

Migration tip: You need to install <code>xclip</code> or <code>xsel</code> first. On Wayland (newer desktops) use <code>wl-copy</code> instead. Many people add a shell alias to make this easier.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows clip / clip.exe maps to xclip / xsel for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

Practical tasks

Common use cases

Copy output to clipboard

Pipes command output directly into the clipboard so you can paste it elsewhere.

xclip -selection clipboard

Copy to clipboard (X11)

xsel --clipboard --input

Alternative clipboard tool

wl-copy

Wayland clipboard tool

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

sudo apt install xclip
cat file.txt | xclip -selection clipboard
pwd | xclip -selection clipboard
alias clip='xclip -selection clipboard'

Walkthrough

Examples with explanations

# Windows: command | clip

# Install first:
sudo apt install xclip

# Copy output to clipboard:
cat file.txt | xclip -selection clipboard
pwd | xclip -selection clipboard   # copy current path

# Handy alias — add to ~/.bashrc:
alias clip='xclip -selection clipboard'
# Then just: cat file.txt | clip

Reference

Common options and variations

Command or optionUse
xclip -selection clipboardCopy to clipboard (X11)
xsel --clipboard --inputAlternative clipboard tool
wl-copyWayland clipboard tool
xclip -oPaste from clipboard to terminal

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "xclip / xsel" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command xclip / xsel Same command on this distribution.
Fedora same command xclip / xsel Same command on this distribution.
Arch same command xclip / xsel Same command on this distribution.

Keep learning

Related Text Processing commands