When you enter a long command into the Terminal window that you found on the web or in a document, you can save yourself some time by easily copying and pasting the command at the prompt.

Update: Read our in-depth guide to copy-pasting text at the Linux command-line for more detailed tips and tricks.

To begin, highlight the text of the command you want on the webpage or in the document you found. Press Ctrl + C to copy the text.

01_copying_text_from_web_page

Press Ctrl + Alt + T to open a Terminal window, if one is not already open. Right-click at the prompt and select "Paste" from the popup menu.

02_selecting_paste_in_terminal

The text you copied is pasted at the prompt. Press Enter to execute the command.

03_text_pasted

The command is executed like you typed in yourself.

04_command_executed

You can also copy text from the Terminal window to paste into other programs. Simply highlight the text, right-click on it, and select "Copy" from the popup menu. You can paste this text into a text editor, word processor, etc.

05_copying_text_from_terminal

When pasting a copied command into the Terminal window, you can use the arrow keys to navigate through the command and use the backspace key to delete text and retype it, if desired. This is useful if you want to copy a long command that has placeholders for certain parts of the command. You can easily change those to customize the command to your needs.

Linux Commands

Files

tar · pv · cat · tac · chmod · grep ·  diff · sed · ar · man · pushd · popd · fsck · testdisk · seq · fd · pandoc · cd · $PATH · awk · join · jq · fold · uniq · journalctl · tail · stat · ls · fstab · echo · less · chgrp · chown · rev · look · strings · type · rename · zip · unzip · mount · umount · install · fdisk · mkfs · rm · rmdir · rsync · df · gpg · vi · nano · mkdir · du · ln · patch · convert · rclone · shred · srm · scp · gzip · chattr · cut · find · umask · wc · tr

Processes

alias · screen · top · nice · renice · progress · strace · systemd · tmux · chsh · history · at · batch · free · which · dmesg · chfn · usermod · ps · chroot · xargs · tty · pinky · lsof · vmstat · timeout · wall · yes · kill · sleep · sudo · su · time · groupadd · usermod · groups · lshw · shutdown · reboot · halt · poweroff · passwd · lscpu · crontab · date · bg · fg · pidof · nohup · pmap

Networking

netstat · ping · traceroute · ip · ss · whois · fail2ban · bmon · dig · finger · nmap · ftp · curl · wget · who · whoami · w · iptables · ssh-keygen · ufw · arping · firewalld

RELATED: Best Linux Laptops for Developers and Enthusiasts