Linux distributions are mostly managed through the terminal. In the terminal, different commands are typed. For example, to update Ubuntu, we run the command “sudo apt update”. To run this command again, instead of typing the command, we can copy and paste it.
Similarly, any lengthy command is hard to write, and typos are expected. To avoid such acts, the commands are copied/pasted into the terminal.
In this blog, different approaches to copying and pasting commands or text in Linux will be explored. The content of this blog is as follows:
- How to Copy and Paste in Terminal?
- Method 1: Using the Keyboard Shortcut Key
- Method 2: Using Mouse keys
- Method 3: Using the Mouse Scroll Buton
Let’s start the guide!
How to Copy and Paste in Linux Terminal?
Copy and Paste is the key process in any operating system. In Linux, the copy/paste actions are usually carried out in the terminal to eliminate typo errors while writing a command. Here, all the possible methods to copy/paste in a Linux terminal are described:
Method 1: Using the Keyboard Shortcut Keys
There are two different shortcut keys to copy and paste into Linux. These shortcut keys are mentioned in the table below:
Shortcuts Keys | Description |
---|---|
Ctrl+Insert or Ctrl+shift+C | These keys will copy the selected commands or text from a terminal |
Shift+Insert or Ctrl+shift+V | These keys will paste the copied commands or text in a terminal |
These commands are not only used in the terminal but can be used in other interfaces of Ubuntu like to copy the text in a terminal and paste it into the web browser or notepad.
Method 2: Using the Mouse Buttons
Another approach to copying the text in the terminal is by using the mouse buttons. To do so, select the text using the mouse and press the “right button”. A dropdown will appear. Choose “Copy” from that:
To paste the copied text, press the right mouse button and click “Paste” from the drop-down menu:
The copied command will be pasted into the terminal.
Method 3: Using the Mouse Scroll Button
This method is simple but not recommended because it works on some Linux distributions. In this method, select the command or text in the terminal and then press the “Scroll Button” to paste the selected commands and text.
The below-mentioned “GIF” demonstrates the usage of the above-explained method:
That’s all about this post!
Conclusion
To Copy and Paste commands/ text in the terminal, mouse buttons and keyboard shortcut keys can be utilized. The shortcut key “CTRL+SHIFT+C or CTRL+INSERT” is used to copy, and “CTRL+SHIFT+V or SHIFT+INSERT” pastes the content. In this blog, three different approaches to copying/pasting commands/text in Linux distributions have been explored.