All That Typing...

So, all this typing has got to stop being fun at some point. Fortunately, the command line offers a number of ways to make your work more efficient.

Auto Completion

Every keyboard has a tab key, and its a very useful thing to have in the terminal. You might have used this keystroke before to indent words in a word processor. You can still do this in GNU/Linux word processors, but when you use tab in the GNU/Linux terminal it becomes such a time saver that when you master it you will be using it all the time.

Essentially, the tab is an auto-complete command. If, for example, I want to move the file 'dsjkdshdsdsjhds_ddsjw22.txt' somewhere with the mv command I can either type out every letter of the stupid filename, or I can type mv (for 'move') followed by the first few letters of the filename and press tab. The rest of the filename will be automagically filled in. If the filename is not filled in it means that there are several files (or directories) that start with those first few letters I typed. To remedy this I could type a few more letters of the filename and press tab again, or to help me out I could press tab twice and it will give me a list of files that start with those letters.

You can also use tab to auto-complete command names. 

tab is your friend, use it a lot.

Copy and Paste

Just because you are working on the command line doesn't mean you can't use some of the conveniences you are used to in the GUI. While cut and paste may work a little differently here from its behavior in other operating systems, you'll soon find it very intuitive.

Copying text is as simple as highlighting the text you wish to copy by holding down the left mouse button and highlighting the text as you are probably already used to doing.

Pasting text The highlighted text that you just copied is held in the clipboard until you paste it where your cursor is by clicking the middle (wheel) mouse button.

Try it! Select the paragraph below with the left mouse button, open a new virtual terminal, and paste the text with the middle mouse button.

 echo "This is pasted text."

After you see the text in the terminal, press the Enter key and the echo command will repeat the text between the quotes on the command line.

Note: If you are copying text from a web page, sometimes the punctuation isn't handled properly. You might actually copy some unseen formatting along with the text, which will break the syntax of the command you are copying.