« Back to James's CS61A page. CS61A: Spring 2000

A Few Things to Do with Your Unix Account


I mostly will assume you have some familiarity with Unix file operations. If not, please look through the CSUA's online introductory Unix tutorial and consider attending some of their help sessions. I also have a summary of some basic Unix commands.



E-mail

How often do you check for e-mail to your class account? only when you're working in a computer lab? only when you log in to run glookup? Not very often, I'd imagine, especially in comparison with your UCLink account. It is important, however, that you check e-mail to your instructional account regularly, as this may be the only way to contact you with class information.

Instead of checking multiple e-mail accounts separately, it's simpler to have all your e-mail redirected to one address by creating a .forward file. At the Unix prompt, type:

echo "foo@example.com\cs61a-??" >! ~/.forward

Of course, replace foo@example.com and ?? with the appropriate destination address and your login respectively.

Please test that it works by sending yourself an e-mail message; it is worse than useless if the forwarding address is incorrect!

To disable e-mail forwarding, remove the .forward file with the command:

rm ~/.forward

News

Please read the class newsgroup (ucb.class.cs61a). If your ISP does not carry it or if it saves only a handful of posts, you can log in to one of the campus computers using ssh and by then using one of the text-based newsreaders available, such as rn, tin, pine, ....

More detailed instructions how to access the newsgroup.


Printing

Text files

Text files may be printed directly with the lp command (or lpr on a few systems).

It's usually better, however, to save paper by using the enscript command; this will print two pages per sheet. Remember that you can use enscript only with text files!

Adobe PostScript files

Adobe PostScript (.ps) files can be printed directly with the lp command. They also may be previewed and printed with ghostview. To print multiple pages per sheet like enscript, look into the psnup command.

Adobe Acrobat (PDF) files

Adobe Acrobat (.pdf) files must be printed from within a PDF reader. Load acroread, xpdf, or ghostview and use the appropriate print command from within the program.

PostScript files may be converted to PDF format with the ps2pdf command. Conversely, there exists a pdf2ps program to convert PDF files to PostScript.

Some of the programs above may not be available for some systems. However, all should be available under HP-UX systems, which is what we'll be using for this course. See /usr/pub/printer.help, and the individual man pages for more information.


Emacs

Emacs is a powerful text-editor that we'll use in the labs.

For those of you used to Microsoft Windows applications, you might prefer to use pc-selection-mode in Emacs. This will allow you to use Shift+<arrow key> to highlight text, Ctrl+Home and Ctrl+End to jump to the beginning or end of a document, and Ctrl+Ins, Shift+Ins, Ctrl+Del to copy, paste, or cut selections. To enable this, hit M-x (the meta key is equivalent to Alt) and type pc-selection-mode. This will only affect your current session only; to make the change permanent, you'll need to add the command to your .emacs file.

To learn more about Emacs, browse the FAQs and documentation at emacs.org.


Shells

A shell is an interpreter that processes instructions from the user to the operating system. For those of you familiar with MS-DOS, command.com is an example of a shell.

Unix instructional accounts by default use csh (the C-shell). While csh may be sufficient to get work done, I recommend switching to tcsh.

Among other features, tcsh offers:

To change your shell permanently, first log in to po.eecs:

ssh po.eecs

If this is the first time you've logged in to po with ssh, you will be asked for confirmation. Type "yes" (a simple "y" will not work) and continue. Once you log in to po, run chsh. When prompted for the new shell, enter:

/usr/local/tcsh

Using tcsh, to configure your command prompt to display your current directory, type:

set prompt = '%~ > '

Your command prompt will display your current directory (relative to your home directory, if appropriate) followed by a ">", separated with spaces. To make this change permanent, add the above line to your .cshrc file, located in your home directory.

For more information on customizations and features available for tcsh, read the tcsh man page. (The tcsh man file may not be available on some systems; try using cory.eecs if necessary.)


« Back to James's CS61A page. CS61A: Spring 2000

Last Modified: Tuesday, 30-Dec-2014 11:58:34 PST