Arrange for what is called a "shell account" on some Unix system. Most Internet Service Providers (ISPs) can provide this service. Use the terminal emulator program and a modem to dial in. Learn the basic Unix commands. If the system has Emacs installed, or you can persuade the system administrator to install it, this is your second chance to learn it. It is probably best to learn it at this point, because administering a Unix system (the next stage) will call for you to edit files. Therefore, I include here my suggestions for learning both Unix and Emacs.
When you arrange for a shell account, or set up a new account on your own machine, you will have to decide on a username and a password. Your username will also be used in your email address, so try to find something short and memorable. Your password is important, and should be hard to guess. That usually means at least six characters, including at least one non-alphanumeric character.
When a Unix system is ready for you to log in, it normally displays a prompt ending with "login:". At this point you should type in your username. It will then prompt you for your password, and will turn off command echoing while you type it in.
The command to finish a terminal session is logout
.
To learn about a command, use the man
command to type its
manual page ("man page" for short). For example, to learn more about
the cp
command by typing man cp
. Of course, this helps only if
you know or can guess the command name. However, each man page has a
line near the beginning with the command name, a minus sign, and a
short description of what the command does. You can search a database
of these lines using the command apropos
. Thus, typing apropos
working
will list lines that include the word "working".
Under Unix, commands normally accept options starting with a minus sign rather than the forward slash used under DOS. In a path, directory names are separated by forward slashes rather than backward slashes. Both operating systems have a "standard input", by default the keyboard, and a "standard output", by default the display screen. You can redirect the standard input using "<", and redirect the output using ">". You can use the output from one command as the input of another by separating the two commands with "|". This is called the "pipe" symbol.
The program that interprets your command is a "shell". Most
shells are decendents of either the Bourne shell sh
or the C shell
csh
. The shell most commonly used with Linux is the "Bourne again
shell", or bash
. It has several features which can reduce the need
for typing. You can use the cursor up key key to bring previous
commands to the command line. The cursor will be at the end of the
command. You can use cursor left and right to move the cursor within
the command, and edit it with Emacs style commands (control-D or DEL to
delete the character to the right, et cetera). Also, you can insert
the last word in the previous command with ESC-. (escape period). You
can learn about these and other commands from the bash man page, in
the section entitled "READLINE".
If a program gets "stuck", here is a sequence of keystrokes to try:
logout
command. You can instead
kill the process, as follows: Run ps
with no arguments. It will
list a header line, then one line for each of your processes. The
first item on each line is the process id number, or PID. The command
used to start the process (or at least the beginning of it) appears at
the end of the line. If the PID were 117, you would kill the process
with the command kill -9 117
.
Guido Gonzato [email protected]
has written an excellent guide
to Linux for (former) DOS users, the DOS2Linux mini-HOWTO. You can
probably find it in the same directory as this document, or else at
ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/mini/.
You can find general Unix information, including manual pages for several systems at http://www.cis.ohio-state.edu/hypertext/man_pages.html
There is a tutorial entitled "Beginning Unix and the C Shell" at http://www.eng.hawaii.edu:80/Courses/C.unix/page-03.html.
You can get general help from http://www.nova.edu/Inter-Links/UNIXhelp/TOP_.html or http://www.eecs.nwu.edu/unix.html
You can find a list of books on UNIX at http://www.eskimo.com/~cher/eskimospace/booklist.html.
When you start Emacs, you will normally list on the command line one
or more files which you will be editing. To edit a file named
"foobar" with Emacs, you would enter the command emacs foobar
.
If you enter the command emacs
with no arguments, GNU Emacs will
assume you are a new user, and print out an introduction which
includes the first five commands you need to learn, approximately as
follows:
Type C-h for help; (`C-' means use CTRL key.) Type C-x u to undo changes. Type C-h t for a tutorial on using Emacs. Type C-h i to enter Info, which you can use to read GNU documentation. To kill the Emacs job, type C-x C-c.
Note the way Emacs documentation refers to key combinations. C-h means hold the control key down while typing "h". You will also run into key combinations like M-v, which is pronounced "meta v". The tutorial suggests holding down the key labeled "edit" or "meta" then typing "v". I have never run across a keyboard with those keys, so I always use the escape key instead: typing "Esc" then "v" (two separate keystrokes). After using Emacs for a long time, I discovered that under Linux, the left "Alt" key works like a "meta" key. You may want to use this. On the other hand, some of these key combinations may conflict with your screen reader or communications program under DOS. Using the escape key is more reliable.
Three of the above commands start with C-h, which may be treated as a backspace by your communications program. In that case, you may access the help command using the long form M-x help. Conversely, you may find that pressing the backspace key starts the help command. This issue is treated in the Emacs FAQ, which is available within Emacs using C-h F or M-x help F. Look for the question "Why does the `Backspace' key invoke help?". In this case, you may also find that C-s and C-q are unavailable because they are used for flow control (XON and XOFF). You should look at the question "How do I handle C-s and C-q being used for flow control?" in the FAQ. For the particular command C-x C-s (save buffer), you may substitute the command C-x s (save-some-buffers). The former command saves the current buffer, while the latter asks the user about each of the modified buffers.
Note in particular the command "C-h t" to start the tutorial. That is one the first things you will want to try. I will only make a couple of comments on the tutorial. To move the cursor, it gives the four commands C-f, C-b, C-p, and C-n (for forward, back, previous line, and next line). These commands always work. However, with a properly installed Emacs, the regular arrow keys should also work. Try them out and use them if you are more comfortable with them. Similarly, you may be able to use home, end, page down, and page up keys in place of the standard commands C-a, C-e, C-v, and M-v. Finally, all Emacspeak commands begin with C-e. Once you start using Emacspeak, you will have to type it twice to get the end of line function. (The "End" key should be unaffected by Emacspeak.)