- 1 1. What is Copy & Paste in Ubuntu? [Basics and Environment Differences]
- 2 2. Copy & Paste in the Desktop Environment (GUI Edition)
- 3 2. How to Copy & Paste in the Desktop Environment (GUI Edition)
- 4 3. How to Copy & Paste in the Ubuntu Terminal (CLI Edition)
- 5 3. How to Copy & Paste in the Ubuntu Terminal (CLI Edition)
- 6 4. How to Manipulate the Clipboard via Command Line (xsel / xclip Edition)
- 7 4. How to Manipulate the Clipboard via Command Line (xsel / xclip Edition)
- 8 5. Copy & Paste Setup and Tips for Virtual Machines and WSL
- 9 5. Copy & Paste Setup and Tips for Virtual Machines and WSL
- 10 6. Common Problems and How to Fix Them [Beginner Pitfalls]
- 11 6. Common Problems and How to Fix Them [Beginner Pitfalls]
- 11.1 Can’t Copy with Ctrl + C in the Terminal
- 11.2 Right-Click Menu Doesn’t Show Up or Work
- 11.3 Copy & Paste Doesn’t Work in WSL
- 11.4 xsel or xclip Don’t Work
- 11.5 Clipboard Content Is Overwritten or Lost
- 11.6 Can’t Copy & Paste in VirtualBox
- 11.7 Copy & Paste Is Unstable or Doesn’t Respond
- 11.8 Troubleshooting Tip: Always Review Your “Environment” and “Method”
- 12 7. Frequently Asked Questions (FAQ)
- 13 7. Frequently Asked Questions (FAQ)
- 13.1 Q1. Why doesn’t Ctrl + C copy in the Ubuntu terminal?
- 13.2 Q2. I get “command not found” when trying to use xsel
- 13.3 Q3. I can’t copy and paste between Ubuntu and my host OS in VirtualBox
- 13.4 Q4. Why does selecting text automatically copy it?
- 13.5 Q5. I can’t copy & paste properly in WSL (Ubuntu on Windows)
- 13.6 Q6. I can copy but not paste—why?
- 13.7 Q7. Is there a way to view what’s in the clipboard?
- 13.8 Q8. What should I do if copy & paste is unstable in the terminal?
- 14 8. Summary: Mastering Copy & Paste in Ubuntu
- 15 8. Summary: Mastering Copy & Paste in Ubuntu
1. What is Copy & Paste in Ubuntu? [Basics and Environment Differences]
Why Copy & Paste Is Important in Ubuntu
In Ubuntu and other Linux-based systems, it’s common to work with terminals and switch between multiple applications. In this environment, being able to copy and paste (a.k.a. “copypasta”) efficiently plays a major role in productivity.
This is especially true when entering commands in the terminal or copying code snippets from the web. The ability to copy and paste easily can significantly impact your workflow.
If you’re used to Windows or macOS, you might be surprised to find that “Copy & Paste doesn’t work the same in Ubuntu!?” This confusion is usually due to slightly different key operations. But once you get used to it, it becomes very intuitive.
Copy & Paste Methods Vary by Environment in Ubuntu
The way you copy and paste in Ubuntu depends on the environment you’re using. Generally, there are three main categories:
1. Desktop Environment (GUI)
This is the graphical “window-based” interface most users are familiar with.
You can use your mouse or common keyboard shortcuts (Ctrl+C
/ Ctrl+V
) to copy and paste—similar to Windows or macOS.
Use cases:
- Copying and pasting files
- Moving text in a text editor
- Transferring data between browsers
2. Terminal Environment (CLI)
The terminal (or console)—the “black screen”—is often used by developers and intermediate to advanced users.
Here, copy & paste operations use unique keyboard shortcuts that take some getting used to.
- Copy:
Ctrl + Shift + C
- Paste:
Ctrl + Shift + V
Note: Ctrl+C
is used to force-stop running processes, so it doesn’t work for copying text in the terminal.
3. Virtual Environments or Mixed OS Setups
In certain environments, extra configuration may be required for copy & paste to work smoothly.
- Ubuntu running on VirtualBox (sharing clipboard with host OS)
- WSL (Windows Subsystem for Linux) with copy-paste between Windows and Ubuntu
In these virtual or hybrid environments, standard copy-paste methods may not work as expected. Additional setup or software installation might be necessary.
When Copy & Paste Doesn’t Work—Check Your Environment
If you’re having trouble copying and pasting in Ubuntu, start by checking what kind of environment you’re working in.
- Are you using a GUI or a terminal?
- Or are you inside a virtual machine?
Knowing which environment you’re in is the first step to finding the right copy-paste method and improving your workflow in Ubuntu.
2. Copy & Paste in the Desktop Environment (GUI Edition)
2. How to Copy & Paste in the Desktop Environment (GUI Edition)
Just like Windows or macOS, Ubuntu features a graphical desktop environment (GUI) that lets you use a mouse and keyboard for intuitive operations. Copying and pasting in this environment works similarly to most mainstream operating systems. This section explains how to handle files and text using standard copy & paste methods.
How to Copy & Paste Files
In Ubuntu’s file manager (commonly “Nautilus” in most distributions), you can copy and paste files using drag-and-drop, right-click menus, or keyboard shortcuts.
Using the Mouse
- Right-click on the file you want to copy.
- Select “Copy” from the context menu.
- Navigate to the destination folder, right-click, and choose “Paste”.
Using Keyboard Shortcuts
- Copy:
Ctrl + C
- Cut (Move):
Ctrl + X
- Paste:
Ctrl + V
Tip:
“Copy” creates a duplicate, while “Cut” moves the file from its original location. Both use Ctrl + V
for pasting.
Copy & Paste in a Text Editor
Copying and pasting in text editors (e.g., Gedit, Pluma, Kate) works the same way as in Windows—using familiar keyboard shortcuts.
Basic Shortcut Operations
- Copy:
Ctrl + C
- Cut:
Ctrl + X
- Paste:
Ctrl + V
Using the Mouse
- Select the text you want to copy.
- Right-click and choose “Copy” or “Cut”.
- Right-click in the target area and select “Paste”.
Pro Tip:
In Ubuntu, selecting text often automatically copies it to the clipboard, and you can paste it by clicking the middle mouse button (wheel click). This is a unique Linux feature that works in terminals and certain applications.
Copying & Pasting Between Applications
Ubuntu’s GUI environment also allows you to copy and paste between different applications like browsers, office software, and text editors with ease.
For example, you can:
- Copy code from a browser and paste it into a text editor
- Copy text from a PDF viewer and paste it into an email or chat tool
However, some applications may have limitations or clipboard bugs that prevent pasting. In such cases, consider alternative methods like using terminal clipboard tools.
The Desktop Is the First Copy & Paste Environment You Should Master
If you’re new to Ubuntu or unfamiliar with Linux, it’s essential to get comfortable with copy & paste in the GUI environment first. It’s intuitive and easy to learn, making it the perfect starting point for mastering Ubuntu basics.
3. How to Copy & Paste in the Ubuntu Terminal (CLI Edition)
3. How to Copy & Paste in the Ubuntu Terminal (CLI Edition)
To fully utilize Ubuntu, learning how to use the terminal is essential. Whether you’re installing software, modifying settings, or reviewing logs, the terminal is a powerful tool. However, copying and pasting in the terminal works differently and is often a stumbling block for beginners.
This section covers the basics of copy & paste in the terminal, including mouse operations and shortcut customizations.
Basic Shortcuts in the Terminal
In Ubuntu terminals (like GNOME Terminal), the copy & paste shortcuts use different key combinations from the desktop GUI.
Correct Key Combinations for Copy & Paste
- Copy:
Ctrl + Shift + C
- Paste:
Ctrl + Shift + V
This setup adds the “Shift” key to distinguish terminal commands from regular GUI shortcuts.
Why Ctrl + C
Doesn’t Work for Copying
Ctrl + C
is assigned in Linux/Unix systems to terminate running processes. So using it inside the terminal won’t copy text—it will stop your current command instead.
Copy & Paste Using the Mouse
If you’re not comfortable with keyboard shortcuts, you can also use the mouse to copy and paste.
Steps
- Click and drag to highlight the text you want to copy.
- Right-click on the selected text and choose “Copy”.
- Right-click at the destination and choose “Paste”.
Note:
In some applications, simply selecting text automatically copies it to the clipboard, and clicking the middle mouse button (scroll wheel) pastes it. However, this method may not work reliably in all environments. For consistency, learning the keyboard shortcuts is recommended.
How to Customize Terminal Shortcuts
Ubuntu allows you to customize terminal keyboard shortcuts.
This is useful if you prefer different key combos or want to match shortcuts from other platforms.
Steps to Configure (Using GNOME Terminal)
- Open the terminal.
- Go to the menu and select “Preferences”.
- Select your active profile and go to the “Shortcuts” or “Key Bindings” tab.
- Change the keybindings for copy and paste as desired.
Examples:
- Changing copy to
Ctrl+C
is not recommended—it conflicts with process termination. - Using
Alt+C
orSuper+C
(Windows key) is a safer alternative.
Mastering the Terminal Starts with Copy & Paste
The fastest way to get comfortable with the Ubuntu terminal is to master copy & paste first.
Typing every command by hand can be exhausting at first, but copying commands from online resources is a great way to learn efficiently.
In the next section, we’ll explore how to manipulate the clipboard directly via command line tools like xsel and xclip. If you’re looking to take terminal usage to the next level, keep reading!
4. How to Manipulate the Clipboard via Command Line (xsel / xclip Edition)
4. How to Manipulate the Clipboard via Command Line (xsel / xclip Edition)
As you become more comfortable working in Ubuntu, you might find yourself wanting to copy command outputs or send data directly to the clipboard from a script.
That’s where tools like xsel
and xclip
come in handy. These command-line utilities let you interact directly with the clipboard.
This section shows how to control the clipboard directly using these tools.
What Is xsel
? A Lightweight Clipboard Utility
xsel
is a lightweight tool that reads and writes to the clipboard in the X Window System. It allows flexible copy-paste operations by working with standard input and files.
How to Install
You can install xsel
in Ubuntu with the following command:
sudo apt update
sudo apt install xsel
Basic Usage
- Copy text to the clipboard:
echo "Hello Ubuntu" | xsel --clipboard
- Copy contents of a file to the clipboard:
xsel --clipboard < sample.txt
- Display clipboard contents:
xsel --clipboard
Key Options
--clipboard
: Accesses the standard clipboard (used withCtrl+C/V
)--primary
: Accesses the “primary selection” (select + middle-click paste)
Note:
Using the --clipboard
option helps ensure compatibility with GUI applications in Ubuntu.
xclip
– Another Handy Alternative
xclip
is another tool similar to xsel
for managing clipboard data. It has slightly different syntax and is preferred by some developers.
Installation
sudo apt install xclip
Example: Copy to Clipboard
echo "Testing xclip" | xclip -selection clipboard
View Clipboard Contents
xclip -o -selection clipboard
Practical Usage: Automate with Scripts
Here are a few examples of how these tools can streamline your workflow:
- Automatically copy the result of a command:
date | xsel --clipboard
- Copy recent error logs to paste into support tickets:
cat /var/log/syslog | grep error | tail -n 20 | xclip -selection clipboard
- Use clipboard contents in a shell script:
CLIP=$(xclip -o -selection clipboard)
echo "Captured content: $CLIP"
If xsel
or xclip
Don’t Work
- They may not work in non-X environments (like WSL).
- They’re also unavailable on headless servers without a GUI.
- In WSL, you’ll need to use other methods like
clip.exe
to access the Windows clipboard.
Using CLI Clipboard Tools Is a Step Toward Advanced Usage
Once you master tools like xsel
and xclip
, your productivity in the terminal will improve dramatically. Being able to move data freely between the GUI and CLI environments will significantly boost your workflow in Ubuntu.
5. Copy & Paste Setup and Tips for Virtual Machines and WSL
5. Copy & Paste Setup and Tips for Virtual Machines and WSL
Ubuntu isn’t limited to physical machines. Many users run Ubuntu in virtual environments such as VirtualBox or VMware, or even in WSL (Windows Subsystem for Linux) on Windows.
However, in these cases, copy & paste may not work out of the box, so proper setup is required.
This section explains how to configure copy & paste in virtual machines and WSL, along with common pitfalls.
Enable Copy & Paste in Ubuntu on VirtualBox
Install Guest Additions
To enable clipboard sharing and drag & drop between host (Windows/macOS) and guest (Ubuntu), you need to install Guest Additions on the Ubuntu virtual machine.
Steps:
- While Ubuntu is running, go to the VirtualBox top menu:
Select “Devices” → “Insert Guest Additions CD image”. - Run the installer from the mounted CD:
sudo apt update
sudo apt install build-essential dkms linux-headers-$(uname -r)
sudo sh /media/your-username/VBox_GAs_*/VBoxLinuxAdditions.run
- Reboot Ubuntu after installation.
Enable Clipboard Sharing
After rebooting Ubuntu, configure VirtualBox to allow “bidirectional” clipboard sharing.
- Shut down the Ubuntu virtual machine.
- In the VirtualBox main window, select your VM → click “Settings” → go to the “General” tab → “Advanced”.
- Set “Shared Clipboard” to “Bidirectional”.
Now, you should be able to copy and paste text between your host and guest systems.
Copy & Paste in WSL (Windows Subsystem for Linux)
WSL lets you run Linux inside Windows 10/11. It’s popular among developers, but its clipboard behavior depends on the terminal settings.
Basic Copy & Paste in WSL
- Copy: Use regular Windows methods (
Ctrl + C
) - Paste:
Right-click
orCtrl + Shift + V
(depends on terminal used)
Note: Behavior may vary depending on whether you’re using PowerShell, Command Prompt, or Windows Terminal.
How to Check Windows Terminal Settings
If you’re using Windows Terminal, follow these steps to verify and enable copy-paste support:
- Click the dropdown arrow at the top → choose “Settings”.
- Select the “Ubuntu” profile.
- Under “Actions”, make sure
Ctrl+Shift+C
andCtrl+Shift+V
are assigned.
What to Do If Copy & Paste Doesn’t Work in WSL
- If you can’t paste in WSL:
- Make sure Windows Terminal and WSL are up to date.
- Older PowerShell or CMD terminals may not support all shortcuts.
- Use
clip.exe
(a Windows command): - Useful for sending output from WSL to the Windows clipboard.
echo "Text from WSL to clipboard" | clip.exe
Things to Watch Out for in Virtual Environments
In virtual environments like VirtualBox or WSL, there’s a boundary between the host and guest OS. You might encounter limitations when copying or dragging files.
- Text copy-paste usually works, but pasting images or files is often restricted.
- Shortcut key conflicts may occur between Ubuntu and the host OS.
- Mouse actions can behave unpredictably, especially in full-screen mode.
In Virtual Environments, Settings Are Key
In virtual environments, proper configuration is even more important than in native Ubuntu setups. If copy & paste doesn’t work, don’t just blame Ubuntu—check your VM settings and Guest Additions first.
In the next section, we’ll cover common issues with copy & paste in Ubuntu and how to fix them. Perfect for beginners who want to troubleshoot effectively.
6. Common Problems and How to Fix Them [Beginner Pitfalls]
6. Common Problems and How to Fix Them [Beginner Pitfalls]
When trying to copy and paste in Ubuntu, beginners often run into moments of “Wait, why isn’t this working?”
Many of these issues happen because users expect it to behave like Windows or macOS.
This section breaks down common copy-paste problems in Ubuntu and how to solve them effectively.
Can’t Copy with Ctrl + C
in the Terminal
[Cause]
In the terminal, Ctrl + C
doesn’t mean “Copy”—it’s a keyboard shortcut for terminating a running process. Using it will interrupt your command instead of copying text.
[Solution]
- Use
Ctrl + Shift + C
to copy - Use
Ctrl + Shift + V
to paste
Once you know this rule, working in the terminal becomes much smoother.
Right-Click Menu Doesn’t Show Up or Work
[Cause]
Some apps or terminal settings may disable right-click context menus. In virtual environments, mouse behavior can also be unstable.
[Solution]
- Enable right-click functionality in terminal settings if available
- Use keyboard shortcuts instead—they’re more reliable
Copy & Paste Doesn’t Work in WSL
[Cause]
Since WSL runs inside Windows, copy-paste behavior depends on the terminal type and settings.
[Solution]
- Use Windows Terminal and verify that
Ctrl + Shift + C/V
are enabled - Older terminals (like legacy PowerShell) may not support paste—use the latest Windows Terminal
- You can also use
clip.exe
orpowershell.exe Get-Clipboard
to work with the Windows clipboard
xsel
or xclip
Don’t Work
[Cause]
- The package may not be installed yet
- You might be using it on a server with no GUI (no X environment)
[Solution]
- Install them with
sudo apt install xsel
orxclip
if needed - On servers without GUI, use alternatives (e.g. write to a file and transfer it)
Clipboard Content Is Overwritten or Lost
[Cause]
Ubuntu (and Linux) has two clipboards: the PRIMARY
(selected text) and the CLIPBOARD
(explicit copy with Ctrl+C
). This can cause accidental overwrites or unexpected paste behavior.
[Solution]
- Be explicit: use
xsel --clipboard
when necessary - Or use
xclip -selection clipboard
for clarity
Can’t Copy & Paste in VirtualBox
[Cause]
- Guest Additions isn’t installed
- Clipboard sharing is set to “Disabled” or “Host to Guest only”
[Solution]
- Install Guest Additions in your Ubuntu VM
- Set clipboard sharing to “Bidirectional” in the VM settings
Copy & Paste Is Unstable or Doesn’t Respond
[Cause]
- Bugs in Ubuntu version or applications
- Performance issues in virtual environments
- If using Wayland session, there may be compatibility issues with some apps
[Solution]
- Try logging in with Xorg instead of Wayland in GNOME
- Restart the terminal or app—you’d be surprised how often this helps
Troubleshooting Tip: Always Review Your “Environment” and “Method”
Most copy & paste problems in Ubuntu come down to using the wrong method for your environment. Before you panic, double-check these:
- What’s your environment? (GUI / Terminal / WSL / VM)
- What method are you using? (Shortcut keys / right-click / CLI tool)
- What are your settings? (Terminal profile, virtual machine config, etc.)
Taking a moment to review these can save you a lot of frustration and help you troubleshoot effectively.
In the next section, we’ll summarize common questions as a quick FAQ for those who want a fast review or clarification.
7. Frequently Asked Questions (FAQ)
7. Frequently Asked Questions (FAQ)
Copy & paste in Ubuntu can be tricky for both beginners and intermediate users. Here we’ve compiled a list of commonly asked questions and provided simple, clear answers.
These FAQs are written to quickly deliver answers to visitors coming in from search engines.
Q1. Why doesn’t Ctrl + C
copy in the Ubuntu terminal?
A1.
In the terminal, Ctrl + C
is used to interrupt or stop a running process. To copy text, use Ctrl + Shift + C
instead.
To paste, use Ctrl + Shift + V
.
Q2. I get “command not found” when trying to use xsel
A2.xsel
is not installed by default. Install it with the following command:
sudo apt update
sudo apt install xsel
The same goes for xclip
—you’ll need to install it separately if you want to use it:
sudo apt install xclip
Q3. I can’t copy and paste between Ubuntu and my host OS in VirtualBox
A3.
To enable copy & paste between host and guest in VirtualBox, you need to install “Guest Additions” in your Ubuntu VM.
Also make sure “Shared Clipboard” is set to “Bidirectional” in your VM settings.
Q4. Why does selecting text automatically copy it?
A4.
This is a Linux-specific feature called the PRIMARY clipboard. Simply selecting text with your mouse copies it to this clipboard.
You can paste this selection by clicking the middle mouse button (wheel click). Note: not all applications support this feature.
Q5. I can’t copy & paste properly in WSL (Ubuntu on Windows)
A5.
Behavior varies depending on the terminal:
- Windows Terminal:
Ctrl + Shift + C/V
- PowerShell/CMD: Right-click or
Ctrl + V
(may not work in all cases)
For best results, use Windows Terminal and check its profile settings to make sure shortcuts are enabled.
You can also copy from WSL to Windows clipboard using:
echo "Send this text to clipboard" | clip.exe
Q6. I can copy but not paste—why?
A6.
Possible causes include:
- The target app may not accept clipboard input
- The middle mouse button may be disabled or unavailable
- You may be confusing PRIMARY vs. CLIPBOARD selections
- There may be restrictions in your VM or WSL environment
Try different methods—keyboard shortcuts, terminal tools, or using clip.exe
if in WSL.
Q7. Is there a way to view what’s in the clipboard?
A7.
Yes, with xsel
or xclip
in the terminal:
xsel --clipboard # View CLIPBOARD contents
xclip -o -selection clipboard # Same as above
In GUI environments, you can install clipboard managers like Clipman or Parcellite to see clipboard history.
Q8. What should I do if copy & paste is unstable in the terminal?
A8.
Try the following steps:
- Switch from Wayland to Xorg at the login screen
- Restart the terminal app
- Try a different terminal like Terminator or Tilix
- Check if your shortcut keys are properly assigned
Unstable behavior often depends on the system environment, so don’t hesitate to try a few different tools or sessions.
8. Summary: Mastering Copy & Paste in Ubuntu
8. Summary: Mastering Copy & Paste in Ubuntu
Copying and pasting in Ubuntu can be confusing at first—especially for newcomers. But once you understand the key differences and environment-specific methods, it becomes a powerful and convenient tool. In this guide, we covered copy & paste operations across various scenarios: GUI, terminal, virtual machines, and WSL.
Here’s a quick recap of the main points:
The Key to Copy & Paste: Adjust by Environment
- In the desktop environment (GUI):
- Use
Ctrl + C
/Ctrl + V
or right-click as you would in Windows - Works similarly in file managers and text editors
- In the terminal (CLI):
- Use
Ctrl + Shift + C
/Ctrl + Shift + V
for copy & paste xsel
andxclip
allow more flexible clipboard operations via command line- In virtual machines (e.g. VirtualBox):
- Install Guest Additions and enable “Bidirectional” clipboard sharing
- In WSL (Windows Subsystem for Linux):
- Clipboard behavior depends on your terminal and its settings
- You can also use
clip.exe
to copy from WSL to Windows clipboard
Most Issues Are Solvable—If You Know the Cause
Ctrl + C
doesn’t copy? → It interrupts processes in the terminal- Can’t paste? → May be due to clipboard type or application limitations
- Issues in virtual environments? → Check settings and install required tools
None of these problems are “just because it’s Linux.” They all have clear, fixable causes once you understand your environment.
Apply What You’ve Learned
- Start with GUI copy & paste if you’re new to Ubuntu
- Once comfortable, explore terminal shortcuts and tools like
xsel
andxclip
- If using a VM or WSL, make sure your integration settings are correct
Mastering basic operations like copy & paste can make a huge difference in your productivity with Ubuntu. It’s a small step that leads to a much smoother and more enjoyable Linux experience.
If you’re planning to dive deeper into Ubuntu:
Eliminating these small frustrations will let you appreciate the flexibility and power of Linux even more. We hope this article makes your Ubuntu journey easier and more efficient.