Copying and Pasting from a terminal window to emacs

Now that you know minimal emacs, let's try a useful trick. Let's copy and paste from a terminal window to an emacs window. To do this, start up emacs with the same command as before:

   emacs junk3 &
Then go to the terminal window and put some text on the screen. For example, type
   man cat
This command puts some information on your screen about the cat command. Let's copy the line with the command syntax (the single line beneath Synopsis) into your file junk3. Follow these steps:
  1. In the terminal window, hold down the left mouse button and sweep across the line starting from the letter c. The highlighted text shows what is copied.

  2. Go to the emacs window and click with the middle mouse button at the point where you want to insert the text. This retrieves the text from the paste buffer.

When you are done practising, exit emacs using Ctrl-x Ctrl-c. Type y if you are prompted about saving your file.

Exit man pages by typing “q” or Ctrl-c in the terminal window.