Classnotes | UNIX01 | RecentChanges | Preferences Showing revision 1 Today we will be looking at some very complicated editors. If you ever find yourself without an editor, or having forgotten how to use an editor, as long as you remember this simple trick, you will be fine.
Recall that the cat command can be used to view a file or to pass the contents of a file (or files) into another file. Well, when run without any commandline arguments it will simply take data from STDIN and redirect it to STDOUT. Thus, you can use it to copy inputted text into a file by using a redirect:
$ cat > some_file
This will take whatever is typed from the keyboard and place it in some_file. To exit this mode, pass the control sequence CTRL-D (which is the EOF, End of File, character).
Small Project
Go ahead and create file calling it "testfile" and place the following inside of it:
This is line 1.
This is line 2.
This is line 3.
This is line 4.