Since Unix is 40 years old, Unix is older than the invention of the computer mouse. (Actually, only 3 years, if Unix is from 1969 and the mouse from 1972.) How in the world did a new user do anything on Unix without copy & paste? I know they always had a text editor with copy/paste, but everything I do on Linux is copy from web browser, and paste (from the CLIPBOARD) into vim or gedit or gnome terminal. You're the same, right?
I just can't imagine loading up a man file into vim, copying & pasting code from it into a temporary buffer, and then having bash execute that buffer. Maybe they never left emacs; is that the answer?
Best Answer
Copy-paste is older than the mouse. The first unix editor, ed, had the
t
command to copy a bunch of lines to a different location. In vi, there are various commands to cut, yank and paste text. To copy text between files, you would save the text to copy in a temporary file and import that temporary file in the target document, e.g. withw
andr
in ed (:w
and:r
in vi). To include the output of a command in a file, you would redirect its output (mycommand >file
ormycommand >>file
) and import that file into your document; vi introduced the!
command and friends to directly insert the output without requiring a temporary file.Loading a man page into Vim or Emacs and copy-pasting from it is routine for Vim/Emacs users. Web browsers didn't exist until Unix was old enough to drink, but the same principle applies anywhere: the clipboard is older than window environments. What window environments brought was cross-application copy-paste, which could be done with only a little more effort through files.