How to copy and paste in Linux terminal without mouse? Learn how to copy in Linux terminal or how to copy and paste files in Ubuntu using terminal.
In most of the application, keyboard shortcuts for Cut, Copy and Paste are Ctrl + X, Ctrl + C and Ctrl+V respectively. But in Linux Ubuntu Terminal, Ctrl+C is Cancel Command and Ctrl + X & Ctrl + V doesn’t work.
How to Copy in the Ubuntu Terminal
Use “Ctrl + Insert” to copy a command. You can also copy text using mouse (right-click). To copy text from the Terminal window, simply highlight the text, right-click on it, and select “Copy” from the menu.
How to Paste in the Ubuntu Terminal
To paste text or commands in Ubuntu Terminal window, use Ctrl + Shift + V. You can also use “Shift + Insert”, to paste the command in the Terminal window.
Ubuntu Terminal Keyboard Shortcut Keys
There are other useful Ubuntu Terminal keyboard shortcut keys that you must know:
- Ctrl + A or Home : Moves the cursor to the start of a line.
- Ctrl+ E or End : Moves the cursor to the end of a line.
- Esc + B : Moves to the beginning of the previous or current word.
- Ctrl + K : Deletes from the current cursor position to the end of the line.
- Ctrl + U : Deletes from the start of the line to the current cursor position.
- Ctrl + W : Deletes the word before the cursor.
- Alt + B : Goes back one word at a time.
- Alt + F : Moves forward one word at a time.
- Alt + C : Capitalizes letter where cursor is and moves to end of word.
- Up Arrow or Ctrl + P : Scrolls through the commands you’ve entered previously.
- Down Arrow or Ctrl + N : Takes you back to a more recent command.
- Tab : It auto-completes any commands or filenames, if there’s only one option, or else gives you a list of options.
- Ctrl + R : Searches for commands you’ve already typed.
- History : The history command shows a very long list of commands that you have typed.
How To Copy And Paste Files In Terminal
To copy a file and paste files in a terminal, you use the cp command. The cp command works exactly like the mv command (move command), except that the cp command duplicates the contents of a file and it does not move the files from one location to another.
Note that the cp command does not ask whether you want to copy one file over another file with the same name or not. It simply copies the files from location to another. To confirm the process of copying files, use cp –interactive (or -i). This command option runs the cp in interactive mode and it will ask you whether you’re sure you want to overwrite an existing file.
It must be pointed that the cp command workd on files, not on folders.