Introduction
Announcements

Schedule
Labs
Assignments
TA office hours

Tests, exam

Topic videos
Some course notes
Extra problems
Lecture recordings

Discussion board

Grades so far

Editing files in unix/linux

For this course (and for the rest of your advanced-computer-using life), you need to create files. Plain text files containing computer programs, shell commands, and so forth.

As mentioned in the "software tools principles" part of the course, in unix we use plain text files as much as possible. A plain text file consists simply of the characters of the text of your data, with a "newline" character at the end of each line. No formatting information; no word processor codes; etc. This file format is the easiest to work with, in all ways.

You want to use an editor to edit these files, and you want it to be a plain-text-oriented editor rather than a word processor.

A simple beginner text editor is "nano". You can type "nano" or "nano file". It tells you the commonest commands in a strip along the bottom of the window. You'll also see other status messages at the bottom of the window.

Sooner or later you will want to use a more sophisticated text editor. The usual choices in unix are vi and emacs. Their styles are quite different, and most people have a strong preference for one or the other.

In all cases, you can say "programname file" to start the editor (e.g. "vi file").

A simple vi tutorial can be found at http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Editors/ViIntro.html

Later on, to become a better vi user, a possible tutorial is http://jerrywang.net/vi/
But don't use ":set ts".

An emacs tutorial which has been recommended is http://www2.lib.uchicago.edu/keith/tcl-course/emacs-tutorial.html