athena 9.4 pocket referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  ·...

20
This document summarizes the most commonly-used Athena commands (i.e., commands you enter at an athena% prompt; see p. 4). Most of these programs are also available — usually in easier-to-use graphical form — from the popup Menu of the GNOME panel (the menu bar found at the bottom of the standard Athena screen). This document is only a reference; for more in-depth introductions to these topics, see Working on Athena or other Athena documents, available from web.mit.edu/olh/. NOTE. Like most Athena documents, this one uses the following conventions: C-x (Ctrl-x) Press x while holding down Control (Ctrl) key M-x (Meta-x) Press x while holding down Meta (Alt or ) key (or: press and release Esc, then press x.) Return Press Return or Enter in main keyboard area LEFT Left mouse button MIDDLE Middle mouse button RIGHT Right mouse button [ item ] Optional item, can be omitted (if used, do not include brackets) Athena, like other UNIX-based systems, is case-sensitive: myfile MyFile. Athena 9.4 Pocket Reference 2 0 0 8-2 0 0 9 Contents MITnet/Athena Rules of Use ................... 2 Athena Basics .............................................. 3 Major Software on Athena....................... 10 Emacs on Athena ....................................... 11 Jabber on Athena ...................................... 16 Zephyr on Athena ..................................... 16 Email on Athena ........................................ 18 Where to Go for Help ............................... 19 Athena QuickStation Locations .............. 19 Athena Cluster Locations ........................ 20 Copyright © 2008 Massachusetts Institute of Technology

Upload: others

Post on 12-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

1

This document summarizes the most commonly-used Athena commands (i.e., commands you enter at an athena% prompt; see p. 4). Most of these programs are also available — usually in easier-to-use graphical form — from the popup Menu of the GNOME panel (the menu bar found at the bottom of the standard Athena screen).This document is only a reference; for more in-depth introductions to these topics, see Working on Athena or other Athena documents, available from web.mit.edu/olh/.

NOTE. Like most Athena documents, this one uses the following conventions:C-x (Ctrl-x) Press x while holding down Control (Ctrl) keyM-x (Meta-x) Press x while holding down Meta (Alt or ◆) key

(or: press and release Esc, then press x.)Return Press Return or Enter in main keyboard areaLEFT Left mouse buttonMIDDLE Middle mouse buttonRIGHT Right mouse button[ item ] Optional item, can be omitted (if used, do not include

brackets)

Athena, like other UNIX-based systems, is case-sensitive: myfile ≠ MyFile.

Athena 9.4 Pocket Reference

2 0 0 8-2 0 0 9

Contents

MITnet/Athena Rules of Use ................... 2 Athena Basics .............................................. 3 Major Software on Athena ....................... 10 Emacs on Athena ....................................... 11 Jabber on Athena ...................................... 16 Zephyr on Athena ..................................... 16 Email on Athena ........................................ 18 Where to Go for Help ............................... 19 Athena QuickStation Locations .............. 19 Athena Cluster Locations ........................ 20

Copyright © 2008 Massachusetts Institute of Technology

Page 2: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

2

MITnet/Athena Rules of Use

from MITnet/Athena Policies ( web.mit.edu/olh/Rules/ )

The boxes below provide only summaries of the rules. For the full text of each rule, see the document MITnet/Athena Policies.

MITnet Rules of Use

Comply with Intended Use of the System: 1. Don’t violate the intended use of MITnet.

Assure Ethical Use of the System: 2. Don’t let anyone know your password(s). 3. Don’t violate the privacy of other users. 4. Don’t copy or misuse copyrighted material

(including software, audio, or video files). 5. Don’t use MITnet to harass anyone in any way.

Assure Proper Use of System Resources: 6. Don’t overload the communication servers;

in particular, don’t abuse your email or instant-messaging privileges.

Additional Rules for Athena Facilities

Comply with Intended Use of the System: A1. Don’t violate the intended use of the Athena system.

Protect Athena Equipment: A2. Don’t eat, drink, or bring food or liquids into the

Athena clusters. A3. Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster, either hardware or

software.

Assure Fair Access to Workstations in Athena Clusters: A5. Don’t violate the official priorities for the use of

workstations; in particular, don’t play games or engage in other non-academic activity if the cluster is busy, and don’t log on to more than one workstation at a time.

A6. Don’t leave your workstation unattended for more than 20 minutes.

A7. Don’t make noise in the Athena clusters; silence your cell phone and use headphones for audio.

Assure Fair Access to Athena Printers: A8. Don’t violate the official priorities for the use of

printers; in particular, don’t be a printer hog or use the Athena printers as copy machines.

Page 3: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

3

Athena Basics

from Working on Athena ( web.mit.edu/olh/Working/ )

Logging inTo log into Athena directly, enter your username and password at the “owl-logo” login screen of any Athena workstation:

For locations of Athena workstations, see pp. 19-20. To connect to Athena from a remote machine (via telnet, ftp, etc.), see p. 10.

Logging Outlogout Log out of Athena, terminating any currently-

running programs (alternatively, you can click on the EXIT button from the GNOME panel menu; this requires that you confirm the logout)

Wait until you see the owl-logo login screen to be sure you are logged out.

Managing Your Sessionrenew Renew your session when your authentication

(Kerberos tickets) and access rights (AFS tokens) expire (default lifetime is 10 hours)

xscreensaver-button & Show screen-saver button, with options to lock your screen while you leave your workstation briefly (see Rule A6, p. 2); click LEFT to lock screen, MIDDLE to see menu (xscreensaver continues to run after screen is unlocked)

xlock Lock the screen immediately

Managing Your Accountpasswd Change your main Athena password (at least once

a semester is recommended); if you also have a browser password, you must change it separately

quota -v Display your disk usage and limit

fs lq ~locker Display disk usage and limit for specified locker (if ~locker omitted, uses locker of current dir)

See Working on Athena for tips about managing passwords and quota.

Page 4: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

4

Athena Basics

X Windows, Metacity, NautilusThe X Window System is the underlying system software that lets your Athena workstation position and display multiple windows. A window manager is a software program that specifies exactly how the X Windows System should render windows (“look and feel”) and defines how you interact with these windows via keyboard commands, mouse actions, etc.

The default window manager on Athena workstations is Metacity, which lets you manipulate windows in ways similar to Microsoft Windows:

To work in a particular window, you first make it the active window. To do this, click in it with the mouse cursor (usually an “I” or an arrow).

If you don’t like the default Metacity look-and-feel, you can change it (via click-MIDDLE >> Customize in the root window), or even use an alternative window manager (such as twm — type man twm for details.)

Nautilus provides a graphical, integrated access point for managing your files and folders.

Enter Commands: Terminal WindowsA simple X window that emulates a standard terminal screen is a Terminal window. You enter Athena commands at the athena% prompt.

gnome-terminal & Create terminal-emulating window; to create a 24-line x 80-column window, position the upper left corner of window with mouse, then click-LEFT; other ways to create a Terminal window: 1) select Prompt icon from GNOME menu panel; or 2) click-MIDDLE in root window and choose New terminal window

exit or C-d Close Terminal window where this command is entered

Terminal window

console window

GNOME panel

root window

Parts of the Initial Athena Workstation Screen.

EXIT button

File manager

Minimize(“iconify”)

Maximize or Unmaximize

Resize[drag any edge]

Move[drag title bar]

Raisein stack[click any visible part of window]

Close Window

Page 5: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

5

File Hierarchy: Lockers and DirectoriesRegardless of which machine they are physically stored on, Athena files are referred to in terms of their location in the Athena AFS file hierarchy:

Athena Basics

Every user is given file space on Athena (the user’s “locker”) with the user’s main directory (the “home directory”) located at: /afs/athena.mit.edu/user/first-letter/second-letter/username

(Here, first-letter and second-letter refer to the letters in the username.) For example (see diagram), jruser’s home directory is located at: /afs/athena.mit.edu/user/j/r/jruser

When you log in, Athena sets the current working directory to your home directory and “attaches” that directory to /mit to allow shorter pathnames. Thus, jruser’s locker is available to jruser after each login as /mit/jruser.

You can “attach” any Athena locker (to which you have access) to /mit:

attach locker Create temporary “mount point” (i.e., link) for specified locker in directory /mit (link is available only during Athena or telnet session, not via ftp or Web access to Athena); to unlink locker from /mit, use detach

add locker same as attach, but also lets executable files (i.e., programs) in that locker be run from the athena% prompt without having to enter full pathname (see p.10)

File SpecificationsIn addition to referring to files by their full Athena pathname (/afs/... etc.), with every letter spelled out, you can use some shortcuts (“wildcards” and relative references) when specifying files in commands. A partial list:

Sym-bol Meaning Examples

~ your home directory (~ is tilde, not dash) ls ~. the current directory fs la ... the directory above the current directory mv x ../other/? any single character ls ?.html* any sequence of 0 or more characters ls *.html

[xyz] [n-m]

any single character from listed set, specified as individual characters or as a range (in terms of the standard ASCII character sequence)

ls [abcde].txt ls [a-zA-Z].txt

See Working on Athena for other symbols/wildcards and additional examples.

You can always test out any shorthand file-specification first with echo:

echo file-spec Show fully-expanded value of file-spec (i.e., what other commands will interpret file-spec to mean if used)

/

afs ... mit ...

athena.mit.edu

... course ... org ... user

1 2 3 ... 8 ... a b c ... a b c ... j ... x y z

8.01 ... chess ... a b c ... r ... x y z

www index.html jruser ...

index.html Mail OldFiles Private Public myfile www

... ... ... ... ...

<– “attached” lockers go here can shortento “athena” –>

“root directory” –>

“org” locker

–>

personal <–locker

course locker–>

Page 6: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

6

Working with Directories and Filespwd Display name of current working directoryecho $HOME Display name of your home directorycd dir Change current working directory to dir

(if no dir is specified, uses your home directory)

mkdir dir Create new directory named dirrmdir dir Remove empty directory named dir

ls List files in current directoryls options file-or-dir List specific file/directory; options include:

-a list all files, including “dotfiles” (i.e., files with names beginning . )

-F list files showing types (in listing, / = dir, * = executable, @ = link)

-l list with long information (mode bits, owner, size, date, name, etc.)

cat file Display file contents all at oncehead -n file Display first n lines of file (if -n omitted, uses 10)tail -n file Display last n lines of file (if -n omitted, uses 10)more file Display file one screenful at a time; once started:

Spacebar move forward one screenfulReturn move forward one lineb move back one screenful/string go to next line containing string? helpq or Ctrl-c quit

cp fromfile tofile Make a copy of file/directory at new locationmv fromfile tofile Move (rename) file/directory to new location

delete file-or-dir Mark file/directory for later permanent removal (file/directory renamed with prefix of .#)

undelete file-or-dir Recover file/directory marked for removallsdel List files/directories marked for removal expunge dir permanently remove files/dirs marked for removal

in directory dir (if dir omitted, uses current dir)purge permanently remove files/dirs marked for removal

in home directory and all sub-directoriesrm -i file permanently remove file immediately (-i option has

command ask for confirmation; be careful!)nOte: If you accidentally remove a file using expunge, purge, or rm, but the file existed previously, you may be able to recover it from the OldFiles directory in your home directory. (OldFiles is an Athena-generated backup copy of your locker).

Creating New FilesYou typically create new files from within application programs (e.g., using the New or Save option from a pull-down menu of a program you’re working in). To create a simple text file, however, you can use the following shortcut (see also the other redirection techniques on p. 9):

cat > file Create a new file by directly entering lines of text; lines of text... if you make a mistake, delete the file (see above) C-d and start again, or edit the file in a text editor;

to add text to an existing file, use >> rather than >

For more complex text files, use Emacs (p. 11) or OpenOffice (see p. 10).

Athena Basics

Page 7: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

7

Athena Basics

Printing Files from Athenafrom Printing from an Athena Workstation (web.mit.edu/olh/Printing)

The following commands are the general printing commands on Athena. For files generated by certain programs (OpenOffice, FrameMaker, LaTeX, etc.), you may need to use alternative print commands not shown here (see the program’s documentation for details about how to print such files).

lpq Find out current default printer

setenv PRINTER printer Set new default printer for a session

lpr [-Pprinter] Print file on printer (if printer omitted, uses [options] file default printer for cluster); options include:

-h don’t print “burst” page (page with info about print job such as username, date/time, etc.); helps save paper

-z send Zephyr message when job is done

lpq [-Pprinter] Show files in printer queue, listing job#s

lprm [-Pprinter] job# Remove a file from the printer queue (use – for job# to remove all your jobs)

lpr [-Pprinter2] Print file on both sides of the page on printer. Apending the numeral 2 to the printer name works with all other printing commands.

Using Diskettes and Other MediaAthena diskette drives accept 1.44MB High Density diskettes. For Athena, disks should be in DOS format. If you need to format a diskette, use:

add mtools; mformat a: format current diskette with DOS format (warning: erases all contents of diskette!)

Sun or Linux Disks. On Sun or Linux workstations, you interact with removeable media using ‘mtools’ commands (enter add mtools first):

mtoolsfm Display graphical file managermdir drive-or-filespec List files on DOS-format disk (default, a:)mcopy filespec1 filespec2 Copy file(s) from/to DOS-format disk (add

-t option if text file to convert correctly)

For filespec, use drive:/path,where drive is a: and path is the file location. E.g.: athena% mcopy abc a:/abc

You can use wildcards to specify multiple files, but certain special rules apply. For more information on these and other mtools commands, see web.mit.edu/answers/workstations/ws_dos.html (or man mtools).

Most Linux machines can create recordable compact disks (CD-R). To burn an “ISO” image to a CD, at the athena% prompt type: nautilus-cd-burner filename.iso

To copy individual files or directories to a recordable CD, double-click on your Home icon and go to Places > CD/DVD Creator. Drag the files or folders into the CD/DVD Creator window; when you are ready to create the CD, go to File > Write to Disc.

USB Drives. Some Athena workstations support USB flash drives. Go to OLC stock answers at web.mit.edu/answers and search for USB.

Page 8: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

8

Sharing Files: Using Access ControlThe following commands apply to files stored on AFS servers only. (Almost all user files are on AFS servers; the bitbucket locker and local hard disks are not.) Note that access control under AFS is applied to all files in a directory, not on a per-file basis. (See Working on Athena.)

(Note: As elsewhere in this document, the square brackets [ ] below indicate that the argument is optional; do not use the square brackets in your commands.)

fs la [dir] [dir...] Show access control list (ACL) for specified directories (default: current directory)

fs sa dir Assign access rights to users of a directory user-or-group rights [user-or-group rights ...] [other-options]

Description of arguments: dir directory for which to show/set ACL

(use . for current directory) user-or-group user/group/process to whom to assign rights:

username a specific usersystem:authuser any user with valid Kerberos

tickets in the same AFS cell system:anyuser any AFS user, incl. non-MITsystem:htaccess.mit MIT-web-certificate holderssystem:expunge automatic fileserver process

that removes old delete filessystem:groupname a system-owned (Moira)

group (use listmaint or blanche command to edit group membership)

rights access rights to give to specified user-or-group: read read and look-up only (= rl) write all rights but administer (= rlidwk) all all rights (= rlidwka)none clear access

or combine single-letter rights: r read contents of files l look up/list file names and directory ACL i insert files/subdirectories d delete files/empty subdirectories w write/edit contents of existing files k set advisory lock on files in directory a administer/change rights on ACL

other-options additional arguments to fs command:help list all options-negative ban users (see Working for details)-clear clear all entries except those in

command line (DANGEROUS: do not remove your own access)

Web. Access control is typically used to privilege/ban other Athena users, but can also define access rights for sharing files via the World Wide Web. For example, giving read permission to system:anyuser makes the set of files readable to anyone via the web (through the machine web.mit.edu): web.mit.edu/Athena-path

Athena-path can be a full path (/afs/...) or abbreviated (starting from locker name).

To restrict web access to Athena files to limited groups (e.g., “only users with MIT IP addresses” or “only specific Athena account-holders”), see web.mit.edu/ist/web/reference/web-resources/https.html.

Athena Basics

Page 9: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

9

Athena Basics

Connecting Output to InputYou can redirect the output of a command to some place other than the screen. (For example, this can be a quick way to capture data in a file.)

command > file Send output of command to new file (creates file)command >> file Append output of command to end of existing filecommand < file Use contents of file as input to command

cmd1 | cmd2 Use output of cmd1 as input of cmd2command | tee file Send (“pipe”) output of command both to screen

and to new file (if file already exists, its contents are overwritten)

command | more Send output of command through more command (useful if command output longer than one screen)

Job and Process ControlProcesses are programs/commands currently running on your workstation. Every process is identified by a unique number, called a process ID (PID). Jobs are processes started by a particular shell; shells read and execute commands. Each Terminal window runs its own shell and has its own jobs.

command Start command in the “foreground” (no other command can be started at this shell until command exits or is placed in the background)

command & Start command in the “background” (command is run but athena% prompt is returned immediately)

C-c Terminate currently running foreground processC-z Stop foreground process (i.e., suspend it without

terminating it)bg Restart stopped process in the backgroundfg or % Restart stopped process in the foreground (or

bring a background process to foreground)

jobs Display a list of jobs with job number and PIDps -fu $USER Show status of your processesps -ef Show status of all processes

kill PID Terminate a process you ownkill -HUP PID Terminate a process you own “nicely”kill -KILL PID Terminate a process you own immediately

who Display list of who’s logged in on current hostw Display list of who’s logged in on current host and

what they are doing

History CommandsA separate history is maintained for each shell (each Terminal window).

history Display recent commands (default = 20)!! Run the previous command!-n Run the nth most recent command!n Run command numbered n in the history list!n:m Use the (m+1)th word from command n!str Run the most recent command that began with the

letter sequence str^str1^str2 Run previous command, substituting str2 for str1

Page 10: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

10

Major Software on Athena

Athena Basics

The following lists only a few of the many software programs on Athena:

Name Description Athena Command *Accessing the World Wide Web

Firefox graphical web browser firefox &Communicating with Others

Evolution graphical email handler see p. 18

Pine non-graphical email handler see p. 18

Jabber instant messaging service gaim & (see p. 16)Zephyr instant messaging service see p. 16Discuss discussion group handler discuss

Working with Text/GraphicsEmacs text editor see p. 11

LaTeX/TeX text formatting language see LaTeX documentsOpenOffice document prep/office suite add ooffice; ooffice &

Working with Math/DataMaple symbolic math add maple; maple &Math-

ematica symbolic math add math; mathematica &

Matlab data analysis add matlab; matlab &Stata statistical analysis add stata; xstata

Tecplot data plotting add tecplot; tecplot &Xess spreadsheet add xess; xess &

* Most of these programs are also accessible from the GNOME panel menu at the bottom of the Athena screen. See web.mit.edu/olh/ for more information about each program listed. For a full list of the extensive set of software on Athena, see “What Runs Where” (web.mit.edu/acs/www/whereruns.html).

Many Athena programs are stored in lockers. To run such programs easily, use the add command (see p. 5). Some programs require that you use add.

Remote Access to AthenaProtocol Connect To ... For ...

SSH/Telnet athena.dialup.mit.edu Login sessions (or ftp); supports

X Windows sessions

FTP ftp.dialup.mit.edu File tranfer sessions

Note: Connecting to these machines requires programs that use authentication and encryption (e.g., SecureCRT, SecureFX, Fetch, OpenSSH). Telnet and FTP programs which do not support encryption will not work. For more details, see “Remote Access to Athena” (web.mit.edu/olh/Remote/).

Page 11: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

11

Emacs on Athena

from Emacs on Athena ( web.mit.edu/olh/Emacs/ )

Emacs is Athena’s powerful (and exhaustively-featured) text editor.

NOTE: Except for the emacs command itself, this section focuses on keyboard and mouse commands you enter within the Emacs application window (i.e., not at the athena% prompt). Many of these Emacs commands are also available via pull-down menus.

Starting the Editoremacs & or Create a new Emacs window for emacs filename & or editing; alternatively, you can start emacs options filename & Emacs from the GNOME panel menu

under Editing/Publishing >> Text Editors >> Emacs or Xemacs

Description of arguments:

filename name of file to edit (existing or new file)

options adjustments to initial Emacs window, etc. (for full set of options, type man emacs); examples:-rv use reverse video-geometry width xheight ±xoffset ±yoffset

specify size and position of window

Example:

athena% emacs -rv -geometry 80x55+30+10 myfile &

Exiting the EditorC-x C-c (“Quit”) exit Emacs, first prompting you to save

any modified buffers

Error RecoveryC-g (“Cancel”) cancel any command — “get out”C-x u (“Undo”) undo the last commandC-l (“Refresh”) redraw garbled screenM-x recover-file (“Recover”) recover a file lost by system crashM-x revert-buffer (“Revert”) restore a buffer to original contents

Editing area

Minibuffer

Status bar

Scroll bar

Menu bar

Emacscursor(“insertionpoint”)

Page 12: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

12

Getting Help within EmacsEmacs has extensive help. Type C-h and follow the instructions.

C-h C-h (“Help”) general help menu with various optionsC-h t (“Tutorial”) especially useful for first-time usersC-h a (“Apropos”) show commands matching stringC-h m (“Mode”) get mode-specific informationC-h i (“Info”) access complete Emacs information treeM-Page Down Scroll Help window

Files and BuffersIn Emacs, you do not edit the contents of a file directly – instead, you work on a temporary working copy held in an editing buffer. Saving a file means writing the current contents of the buffer out to the associated file on disk. Until then, any editing changes you make exist only in the buffer.

Using buffers, you can create and edit multiple files in a single text-editing session — you do not need to start a new Emacs process to edit each new file. (Many Athena users keep Emacs running all the time!)

C-x C-f (“New”) open a new buffer associated with a new filename (file does not exist until buffer is saved)

C-x C-f (“Open File”) read existing file into new bufferC-x d (“Open Directory”) open dir with edit optionsC-x C-s (“Save”) save current buffer into associated fileC-x s (“Save All”) prompt to Save all modified buffersC-x C-w (“Save As...”) save buffer under another filenameC-x C-b List all existing buffersC-x b Select another bufferC-x k (“Close”) delete buffer (does not delete disk file)M-x lpr-buffer (“Print”) print contents of current buffer

WindowsEmacs “windows” are separate panels within the one overall Emacs application window. Typically, different “windows” hold different buffers. Often, you will work with only one window visible.

C-x 1 Hide all other windows except the one cursor is inC-x 0 (“zero”) Hide window the cursor is inC-x 2 Split window in two horizontallyC-x ^ Enlarge windowC-x o (“oh”) Move to other window (or next in sequence)M-Page Down Scroll other window downM-Page Up Scroll other window upC-x < Scroll window rightC-x > Scroll window left

MinibufferEmacs may prompt you for information in the minibuffer. Some options:

Tab Have Emacs complete as much as possibleSpace Have Emacs complete up to one wordReturn Have Emacs complete and execute the command? Show possible completions (without executing)C-g Abort current command

Emacs on Athena

Page 13: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

13

Moving the CursorThe Emacs cursor (“insertion point”) is a character-wide reverse-video box in the current Emacs window that marks the location in the current buffer where keyboard actions will take effect (e.g., inserted text goes just before the cursor). The X Windows mouse cursor is not the Emacs cursor.

single-click-LEFT Move Emacs cursor to mouse position

M-< Go to beginning of current bufferM-{ Go to beginning of current paragraphM-a Go to beginning of current sentence

C-p or ↑ Move to previous lineC-a Go to beginning of current line

M-b Move back one wordC-b or ← Move back one characterC-f or → Move forward one characterM-f Move forward one word

C-e Go to end of current lineC-n or ↓ Move to next lineM-x goto-line Go to line n

M-e Go to end of current sentenceM-} Go to end of current paragraphM-> Go to end of current buffer

C-v Scroll to next screenful of textM-v Scroll to previous screenful of textC-x < Scroll screen leftC-x > Scroll screen right

C-x C-x Exchange cursor with mark (see regions, below)

Inserting TextTo add text to a buffer, simply type at the keyboard: text is inserted before the Emacs input cursor. To create blank lines, just use multiple Returns.

C-x i (“Insert File”) insert contents of another file into this buffer, inserting at the Emacs cursor

M-x insert-buffer Insert text from other bufferC-q control-char Insert control character

Marking/Selecting a RegionA region is all the text between a set mark and the Emacs cursor.

C-Space Set mark here (at current Emacs cursor location)C-x C-x Exchange point (Emacs cursor) and markM-@ Set word markM-h Set paragraph markC-x C-p Set page markC-x h Set buffer mark

double-click-LEFT Select wordtriple-click-LEFT Select linedrag-LEFT Select arbitrary region between click/release

M-x write-region (“Save Selected...”) save marked region as a fileM-x lpr-region (“Print Selected”) print contents of current region

Emacs on Athena

Page 14: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

14

Killing and Deleting/Copy and PasteKilled text is placed into the kill buffer and can be retrieved. You can use kill and yank to move text, or copy and yank to copy text. (Some Emacs kill commands also enter text into the X cut buffer so you can paste it into other X applications.) Forward kills include the text currently under the cursor, backward kills do not.

Deleted text is not placed into the kill buffer, and thus is not retrievable (except by C-x u, the “Undo” command – see p. 11).

Backspace Delete previous characterC-d Delete current character

C-u - M-z c Kill (zap) backward to character cC-x Backspace Kill sentence backwardC-u 0 C-k Kill line backwardM-Backspace Kill word backward

M-d Kill word forwardC-k Kill line forward M-k Kill sentence forward M-z c Kill (zap) forward to character c

C-w (“Cut”) kill regionM-w (“Copy”) copy regionC-y (“Paste”) yank back (restore) last thing killed or

copiedC-u 2 C-y Yank back next-to-last thing killed or copiedC-y M-y M-y ... Cycle through previous kills/copies

RIGHT (“Copy”) copy text between Emacs cursor and mouse cursor into X cut buffer, and into Emacs kill ring

double-click-RIGHT (“Cut”) cut (kill) text between Emacs cursor and mouse cursor into X cut buffer, and into Emacs kill ring

MIDDLE (“Paste”) paste text from X cut buffer to buffer location under mouse cursor and set Emacs cursor at end of pasted region

C-x r k Kill rectangle defined by mark and cursorC-x r d Delete rectangle defined by mark and cursorC-x r y Yank last killed rectangle

SearchingC-s (“Find”) search forwardC-r Search backward

Emacs prompts for search string, then finds it incrementally as you enter it. Fix typos with Backspace key. Valid actions:

C-s Look for next occurrenceC-r Search backwardsEsc End search (keep cursor at position)C-g Cancel search (go back to starting location)C-w Grab word after cursor as search stringC-y Grab rest of current line as search string

Emacs on Athena

Page 15: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

15

ReplacingM-% (“Replace”) interactively replace a text string

Emacs finds each occurrence and prompts for action. Valid actions:

Space or y Replace this occurrence. Replace this, then exit, Replace this and display resultBackspace or n Skip to next without changingReturn or q Exit without doing any more! Replace the remaining without prompting^ Go back to the previous occurrenceC-r Enter recursive editing mode (M-C-c to exit)C-h Display these options

Fill and Line WrapFilling a block of text involves fitting the words within the current margins, by wrapping the text (moving words falling beyond the current margin to the next line) and inserting carriage returns at the break points.

C-x f Set right margin to current columnC-u n C-x f Set right margin to column nM-x auto-fill Enter or exit auto-fill mode (off by default)M-q Fill current (or next) paragraph

Changing CaseM-u Change current (or next) word to uppercaseM-l Change current (or next) word to lowercaseM-c Capitalize current (or next) word

C-x C-u Change all text in region to uppercaseC-x C-l Change all text in region to lowercase

TransposingC-t Transpose current and previous characterM-t Transpose current and previous wordC-x C-t Transpose current and previous line

SpellingM-x ispell-word Check spelling of current wordM-x ispell-region Check spelling of all words in regionM-x ispell-buffer Check spelling of all words in buffer

M-x flyspell-buffer Have Emacs check spelling of each word in file as you enter it (i.e., interactively =“on the fly”)

MacrosMacros let you capture a complex sequence of editing actions for later use:

C-x ( Start defining keyboard macroC-x ) End keyboard macro definitionC-x e Execute last-defined keyboard macroC-u n C-x e Execute last-defined macro n timesC-u C-x ( Append to last keyboard macroM-x name-last-kbd-macro Name last keyboard macro

Emacs on Athena

Page 16: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

16

Zephyr on Athena

from Zephyr on Athena ( web.mit.edu/olh/Zephyr/ )

Zephyr is the default instant-messaging system on Athena, letting users communicate online in real time. A zephyrgram is a pop-up window that includes a text message and info about the sender. Intended recipients must be logged in and running a zephyr client zwgc to receive messages. (zwgc is usually started automatically when you login.)

To get rid of a zephyrgram, click-LEFT on it with the mouse. To copy the contents of a zephyrgram, Shift-click-LEFT and drag over text (special effects such as boldface will not be retained when the text is pasted).

Locating Individual Userszlocate usernames Find out whether specified user(s) are logged in

and subscribing to Zephyr messages

znol Indicate which users listed in your ~/.anyone file are currently logged in; for rest of session, you are notified when any of these users logs in/out

znol off Disable login/out notifications for session

Subscribing to Zephyr Classes/InstancesZephyr classes/instances let groups of people have conversations via zephyr. You specify a conversation as a three-part subscription string, e.g.:

class instance recipient Allows you to receive...Examples of subscriptions automatically added for you

message personal your- username messages sent directly to you

operations message * notices about Athena (e.g., cluster closings)filsrv locker * notices about locker (added when you attach)

Examples of interesting subscriptions you might consider addinghelp * * informal questions other users can answer

mail * your- username

notifications of new email for you (for more advanced options, see Zephyr on Athena)

Jabber on Athena

from MIT Jabber Instant Messaging Service ( web.mit.edu/ist/services/messaging/jabber.html )

Jabber is an instant-messaging system that lets users communicate with one another and Jabber users elsewhere on the Internet (e.g., GMail’s chat feature). Jabber also supports creation and joining of chat rooms for group communication. Additionally, many Jabber clients include support for other instant-messaging systems such as AIM (AOL) and YIM (Yahoo).

The Jabber service relies on clients which support it. On Athena, the Jabber client is Gaim. To start Gaim, at the athena% prompt, type:

gaim &

A default Jabber profile has been created for you. In gaim, click Sign on (your existing Kerberos tickets are used for authentication)..

Page 17: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

17

NOTE: To use “*” as the instance or recipient in a zctl command entered at the athena% prompt, enter it as \* or Athena will interpret it as a shell wildcard (see p. 5). This is not necessary if you enter * while editing the ~/.zephyr.vars file directly.

zctl action subscr Subscribe/unsubscribe to Zephyr messages specified by subscr; possible actions include:

sub subscribe for this session onlyadd subscribe, add subscr to ~/.zephyr.subsunsub unsubscribe for this sessiondelete unsubscribe, remove subscr from file

Setting Your Zephyr Exposurezctl set exposure Set your Zephyr visibility for other users; settings exposure-level last until you change them again; some examples:

net-announced visible to zlocate/znol/zwritenet-visible visible to zlocate/zwriteopstaff visible to zwrite only (=hide)none invisible: no information

about you is available, and you will not receive messages

zctl hide “Hide” from zlocate/znol (zwrite can reach you)

zctl unhide Resume your default exposure level

zctl wg_shutdown Stop receiving zephyrgrams for this session

Sending Zephyr Messageszwrite recipients Send zephyrgram to specified user(s) (you are

prompted for message); recipient(s) must be logged in and subscribing to messages

zwrite -c class Send zephyrgram to users subscribed to specified -i instance class/instance (if -c class omitted, assumes recipients class message; if -i instance omitted, assumes

instance personal; if recipients omitted, assumes *); you should also subscribe (zctl) to instances you send messages to, or you risk missing replies

zctl set Change your Zephyr signature (identity shown in zwrite-signature zephyrgrams you send) to "new-sig" (otherwise "new-sig" uses your name as returned by finger command)

Example. Send a message to users subscribed to the “help” instance:

athena% zwrite -c help

Format. You can format the messages you send via zwrite:

Effect Some Commands * ExampleFont face roman, b (bold), i (italic) Them's @b(strong words!)Alignment l (left), c (center), r (right) Here and @r(there)Font size small, medium, large, huge That's @huge(awfully big) of youText color color(colorname) ** I'm feeling @(@color(blue) sad)Font font(fontname) ** Get @(@font(lucidasans-12) real )

* Most commands are entered as @command( text ). If you need parentheses in your message, use other command delimiters: { }, [ ] or < >.

** For colors, see showrgb | more. For fonts, see xlsfonts | more or xfontsel.

Harassment. If you are being harassed via Jabber, Zephyr, email, or in any other way, contact [email protected] or the Campus Police (enter 100 on campus phones).

Zephyr on Athena

Page 18: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

18

Email on Athena

from Electronic Mail on Athena ( web.mit.edu/olh/Email/ )

Options for Email: Athena and MoreYour email at MIT is stored on a central machine (post-office server). You can manage this email in several ways — download it locally, administer it directly on the post-office server, etc. Typically, users employ a combination of methods (e.g., one on campus, another while traveling).

You can access your email through any method compatible with MIT's email system; you are not restricted to Athena programs. Supported options include:

Option* Description CommandAthena-Based Programs

Ximian Evolution

graphical email handler within personal productivity suite (type man evolution for info)

athena% evolution &or Mail icon (in GNOME menu bar at bottom of Athena screen)

Pine non-graphical menu-based email interface, particularly useful when logging in remotely to Athena

athena% pine

Programs Beyond AthenaOutlook email program for Windows itinfo.mit.edu/

product?name=outlookincluded in Microsoft Office

Apple Mail email program for Macintosh itinfo.mit.edu/product?name=applemailincluded in Mac OS X

Web-Based MIT Email ServiceMIT Webmail

web interface to MIT email, ac-cessible from any web browser (nOte: does not require MIT certificates)

webmail.mit.edu/

* See the Email on Athena document for more information about Athena email options, particularly how to manage messages in Ximian Evolution and Pine.

Mailing Lists. MIT supports two kinds of mailing lists: Mailman lists (see web.mit.edu/lists/mailman/); and Moira lists (also used as access control lists, see p.8). Moira is the core list-management system for Athena; see web.mit.edu/moira.

Mail Forwarding. To have email that is sent to you automatically forwarded to another email address, use chpobox. (See man chpobox.)

Play by the Rules. Use of email at MIT, like all network-related activity, is subject to the MITnet Rules of Use (see p. 2 for info and references).

Spam Screening. Users of MIT email have the option of screening incoming messages for unsolicited email ("spam"). You can set own your spam threshold and allow/deny lists See web.mit.edu/ist/services/email/nospamChain Letters. Email messages that ask you to pass them on to other users are almost always hoaxes (see HoaxBusters.ciac.org). Forwarding chain letters is prohibited at MIT. Just delete these letters.

Harassment. If you are being harassed via email (or in any other way), contact [email protected] or contact the MIT Police (dial 100 on any campus phone — there are phones in most Athena clusters; see p. 20.)

Page 19: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

19

QuickStations are Athena workstations that allow limited (< 15 minute) logins for quick activities such as checking email, printing a file, etc. (for details see web.mit.edu/answers/workstations/quickstations).

How Many?

Loca-tion Where to Find Them

2 W20-102 within CopyTech Center

2 W20-300 outside Lobdell 3rd-floor entrance, near Coffee House

2 1-150 outside classroom near Athena cluster

1 7-4xx northeast side

1 11-004 within CopyTech Center

4 11-112 outside Student Services Center

1 16-1xx in lobby of Building 16

2 32-1xx in lobby of Stata, outside 32-155

1 56-129 within Athena Cluster

QuickStations are also located in semi-public MIT areas such as the MIT Museum, MIT Medical (4th floor), and the Pierce Boathouse — and in many dorms (inquire at your dorm’s front desk for more information).

Athena QuickStation Locations (as of 8/1/2008)

For Help ... Contact...

Athena Accounts, Mailing Lists,

Passwords

User AccountsN42, x3-1325, [email protected]/accounts

Athena Software, General Help

Athena ConsultantsN42, x3-4435, [email protected]/consultfor answers to common questions, go to web.mit.edu/answers

Using Athena in Dorms/ILGs

Residential Computing Consultants (RCC)web.mit.edu/rescomp

Athena Hardware Hardware Services Hotlinex3-1410, [email protected]

TrainingComputer Training at [email protected]/ist/topics/training/

Documentation Athena Documentationweb.mit.edu/olh

Linux, Macintosh, Windows

Computing Help DeskN42, x3-1101, [email protected]/ist/helpdesk

Faculty/TA Use of Educational

Technology & Athena

Educational Technology ConsultantsNE48-308, x3-0115, [email protected]/oeit

Some Helpful Athena Commandsman command Display reference manual page about commandxman & Start X interface for browsing manual pagesapropos keyword List all manual pages with keyword in summaryadd consult; version Display information about the Athena

workstation you are currently logged into

Where to Go for Help

Page 20: Athena 9.4 Pocket Referenceist.mit.edu/sites/default/files/migration/topics/... · 10/1/2008  · Don’t turn off the power to Athena equipment. A4. Don’t reconfigure the cluster,

20

Athena Cluster Locations (as of 8/1/2008)

Location Phone Athena Workstations

Athena Printers

Linu

x

Sola

ris

Win

dow

s

Mac

into

sh

Most are HP LaserJet 8150

W20-575 * x3-0103 58 34 24 ajax, ceres, fiber, metis, pulp, python

2-032 x3-2190 16 corfu2-225 x3-0106 13 celine4-167 x3-0105 5 4 sanda7A-100 (Rotch) 6 pietro10-500 (Barker) x3-7637 5 (none)10-600 (Barker) x3-6177 7 barker12-182 x3-0187 16 10 savion, bias, maia14S-0xx (Hayden) x3-6190 8 hayden26-139 13 (none)37-318 x3-0179 12

acantha, electra, varan37-312 1 2537-332 838-370 x3-5238 9 11 peecs56-129 * x3-0152 18 6 helios, nysa66-080 x3-4474 21 1 homer, pindarE51-075 * x3-0173 5 2 2 picus, lotus

W20-115 x8-0859 CopyTech Express ** w20thesis, *** color-w20-copy

11-004 x3-2806 CopyTech ** thesis ***

For computer cluster help, see web.mit.edu/acis/problems.html * Collaborative workspace in cluster; see web.mit.edu/acis/labs/collabo-

ration_tools.html ** For CopyTech hours, see web.mit.edu/ctc/www/locations.htm*** Use for the final copy of your thesis only (uses archival bond paper).

Cluster Door Combo: before Oct 2008 58489after 1 Oct 2008 85329

tellme combo show current Athena cluster door combinationcview show cluster info as table (= www.mit.edu/cview)cview printers show printer info (= www.mit.edu/cview?printers)xcluster & show cluster info graphically (on MIT map)