How to Copy and Paste in Linux: A Complete Guide
Linux handles copy and paste differently depending on where you are — the desktop, a terminal, or a graphical application. If you've switched from Windows or macOS, the behavior can feel inconsistent at first. That's because Linux doesn't have one universal clipboard system. It has several, and understanding how they work changes everything.
Why Copy and Paste Works Differently in Linux
Most operating systems have a single clipboard. Linux — particularly when running the X Window System (X11) — maintains multiple clipboard buffers simultaneously. The two you'll encounter most often are:
- The clipboard selection — works like the clipboard you know. You explicitly copy with Ctrl+C and paste with Ctrl+V.
- The primary selection — a Linux-specific feature where any text you highlight with your mouse is automatically copied, and middle-clicking pastes it instantly.
This dual-clipboard behavior is a feature, not a bug — but it surprises almost everyone coming from another OS. Wayland, the newer display protocol replacing X11 in many modern distros, handles this somewhat differently, though most desktops maintain backward compatibility with both selections.
Copying and Pasting in Graphical Applications 🖱️
In standard GUI apps — browsers, text editors, file managers — copy and paste works almost identically to Windows:
| Action | Shortcut |
|---|---|
| Copy | Ctrl+C |
| Cut | Ctrl+X |
| Paste | Ctrl+V |
| Undo | Ctrl+Z |
You can also right-click on selected text and choose Copy or Paste from the context menu. Most modern Linux desktop environments (GNOME, KDE Plasma, XFCE, etc.) support this without any configuration.
The primary selection is also active here. Highlight any text with your mouse and it's immediately available to paste anywhere with a middle mouse click — no Ctrl+C required.
Copying and Pasting in the Linux Terminal
The terminal is where most new Linux users get confused. In terminal emulators, Ctrl+C is reserved — it sends an interrupt signal to stop a running process, not copy text. Using it on selected text will kill whatever command is running.
Instead, terminal copy-paste uses a modified shortcut:
| Action | Shortcut |
|---|---|
| Copy | Ctrl+Shift+C |
| Paste | Ctrl+Shift+V |
These shortcuts work in most popular terminal emulators: GNOME Terminal, Konsole, Xterm, Alacritty, and others. Some terminals let you remap these in their settings if you prefer different bindings.
The primary selection still works in terminals too. Highlight text with your mouse, then middle-click anywhere in the terminal to paste it — even across different terminal windows or into a GUI app.
Pasting Into the Terminal From Other Apps
If you copy text from a browser or document with Ctrl+C, you paste it into the terminal with Ctrl+Shift+V. If you highlighted text somewhere without explicitly copying it, middle-click works instead.
Command-Line Clipboard Tools
When you're working deep in the terminal — writing scripts, piping output, automating tasks — you may want to interact with the clipboard programmatically. Two common tools handle this:
xclip— works with X11 clipboards and supports both the clipboard and primary selectionsxdotool/wl-clipboard—wl-clipboard(specificallywl-copyandwl-paste) is the equivalent for Wayland sessions
Examples using xclip:
# Copy command output to clipboard echo "Hello Linux" | xclip -selection clipboard # Paste clipboard content into terminal output xclip -selection clipboard -o Examples using wl-clipboard (Wayland):
# Copy to clipboard echo "Hello Linux" | wl-copy # Paste from clipboard wl-paste These tools aren't always installed by default. You can add them through your distro's package manager — apt, dnf, pacman, or whichever applies to your system.
Variables That Affect Your Experience 🐧
Several factors shape how copy and paste actually behaves for any individual Linux user:
Display server (X11 vs Wayland): X11 has been the standard for decades and has broad app support. Wayland is increasingly default on newer distros like Fedora and Ubuntu 22.04+. Some older tools and clipboard utilities only work on one or the other.
Desktop environment: GNOME, KDE, and others each include their own clipboard managers, which may add history, formatting options, or sync features. Minimal setups (like using a standalone window manager such as i3 or bspwm) often ship with no clipboard manager at all — meaning your clipboard clears when the source application closes.
Terminal emulator: Not every terminal handles Ctrl+Shift+C/V. Some older or minimal emulators use different defaults. Check your terminal's keyboard shortcut settings if standard shortcuts don't respond.
Remote sessions: If you're working over SSH, clipboard sharing between your local machine and the remote session doesn't happen automatically. Tools like tmux have their own internal copy mode, and plugins exist to bridge its clipboard with the system clipboard.
Application-level quirks: Electron-based apps (like VS Code or Slack) generally follow standard Linux clipboard conventions, but some applications — especially those ported from other platforms — occasionally behave unexpectedly.
The Clipboard Behavior Spectrum
A user running a fully configured KDE Plasma desktop on X11 gets clipboard history, cross-app syncing, and consistent shortcuts out of the box. A user running a bare-bones Arch Linux install with a tiling window manager might find clipboard contents disappear the moment they close a window — and need to install and configure a clipboard daemon manually.
The gap between those two experiences is wide, and where any given Linux user falls on that spectrum depends entirely on their distro, desktop environment, display server, and how much of the system they've customized or left at defaults.
Understanding whether you're on X11 or Wayland, which terminal emulator you're using, and whether a clipboard manager is running in the background are the variables worth investigating first before troubleshooting any specific copy-paste issue you're running into.