UNIX Guide

Basic UNIX Commands

Helpdesk has references that are good enough that I don't feel the need to retype them here.

Save typing at the command line

history - will list with numbers the last commands you have entered

Note: Instead of saying "exclamation point", we say "bang".

!! - will run the last command again
!15 - will run the command numbered 15 in your history
!j - will run the last command line that you typed that started with j
!g++ - will run the last g++ command line

Note: It will not remember between logins or across multiple windows.

Printing from UNIX

Again, helpdesk already has a guide.

Help

In UNIX they're called "on-line manual pages" or "man pages" for short. These man pages are your friend.

To search for a topic in the on-line manual pages type "man -k topic". If there are several listings that you don't catch because of scrolling type "man -k topic | more".

From this listing you can choose what manual pages might be helpful to yourself. The listing will give the names of the related pages as "pages(someindex)". To view the correct page, type "man -s someindex pages".

One can also simply type "man subject", but you might not receive any information, or information relating to something else (like a fortran command. ick.)

If you're looking up a C/C++ command, near the top it will tell you what files you need to include.

At the end of the page, it points you to some other related topics.

Sending Email

Helpdesk has an on-line guide for mutt

Viewing the contents of a text file

To see the contents of a small text file, type cat filename

But if the file is big, the text will scroll by quickly. In order to page through the file, type more filename

Editors

There are three editors that are used alot on UNIX: pico, emacs, and vi.

pico is a user-friendly editor. It is the default editor you get when you use elm to send email. But it is not as powerful as the other editors (for example, there is no command to do "search and replace"). Look at the bottom of the screen. You should see a list of commands and the corresponding keys (^ means hold down the CONTROL key). The most important command is help ^G.

jpico is a version of pico that is more oriented towards programmers. Click here to be taken to a small guide.

emacs is a semi-user-friendly editor. It is similar to older editors like WordPerfect before they got menus. You have to memorize key strokes for all the commands. Read the initial message. It will disappear the first time you press a key. Help is CTRL-h.

vi is very powerful, but saying it is not user-friendly is an understatement. Just like emacs, you must memorize key strokes. However, you cannot just type. You have to be in either insert mode or append mode. The helpdesk has a reference sheet


Last modified .....It is now .