The Scientific Computing Laboratory is located at R735 Sir Run Run Shaw Building, Ho Sin Hang Campus, Hong Kong Baptist University. An UNIX computer system is in service. This laboratory is mainly dedicated for MSc students in Scientific Computing, but also serves Science Faculty staff, postgraduate students and authorized third year undergraduate project students of the Science Faculty.
This handbook is written for the users who are working in the S cientific Computing Laboratory. The purpose is to help users to get familiar with the laboratory, to learn AIX (IBM UNIX operating system) and to use the facilities provided by the system.
Throughout this handbook, the following conventions have been adopted:
Applicants can get application forms in R734 or R735. Applications should be approved by the laboratory co-managers.
User should set their password as soon as they log into their accounts at the first time (see page 5). They should change their password periodically for security purpose.
Users can work in the laboratory or remotely log on the system from other computers, which have been connected to University network system. Users can also access the machines through modem supported by ITSC.
| Monday - Saturday: | 9:00 - 22:30 |
| Sunday and Public Holiday: | 12:00 - 22:00 |
| Time | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
|---|---|---|---|---|---|---|
| 9:00-18:00 | R734 | R734 | R734 | R734 | R734 | *R734 |
R734 - Staff-in-charge could be contacted at R734.
*R734 - Staff-in-charge could be contacted at R734 when there is a laboratory
class.
| * | IBM RS/6000 Model 3BT (Compute Server) 187.2 SPECint92 205.3 SPECfp92 IBM Power 67 MHz CPU 1 GB Hard disk 17" Color Display 3 1/2" Floppy Disk Drive 128MB RAM |
x 1 |
| * | IBM RS/6000 Model G30+ (File Server) IBM PowerPC 604 112 Mhz CPU x 2 ASCII Display CD-ROM Drive SCSI-2 FAST/WIDE DIFF 1 GB internal hard disk 2 GB and 4.5GB x 2 external hard disk |
x 1 |
| * | IBM RS/6000 Model C10 (File Server) 90.5 SPECint92 100.8 SPECfp92 IBM Power PC 601 80 MHz CPU ASCII Display 3 1/2 Floppy Disk Drive SCSI-2 FAST/WIDE DIFF 2GB SCSI-2 Hard Disk x 2 3 1/2" 2.88MB disk 64 MB RAM |
x 1 |
| * | IBM RS/6000 Model 41T 88.1 SPECint92 98.7 SPECfp92 80 MHz PowerPC 601 CPU 540 MB Hark Disk 17" Color Display 32MB-256MB RAM |
x 12 |
| * | IBM RS/6000 Model 41T 88.1 SPECint92 98.7 SPECfp92 80 MHz PowerPC 601 CPU 540 MB Hark Disk 20" Color Display 32MB-64MB RAM |
x 4 |
| * | Hewlett Packard Entria X-terminal 10 MB RAM |
x 6 |
| * | Hewlett Packard Envizex X-terminal 10 MB RAM Audio input device |
x 4 |
| * | IBM 4039 laser printer | x 1 |
| · | 4mm Tape Drive | x 1 |
| · | 644MB CD-ROM Drive | x 1 |
| . | Colour Scanner | x 1 |
| TeX | Typesetting software |
| elm, pine | Email tools |
| joe, pico, emacs, asWedit | Screen editor |
| tin | USENET news reader/poster |
| mosaic, netscape | World Wide Web browser |
| xv | Graphics Viewer |
| cxterm, cxtermb5 | Chinese xterm (GB or BIG5 encoding) |
| xarchie | public domain software finder |
| pvm | parallel virtual machine |
| gnuplot | interactive function curve plotter |
| xgraph | window based curve plotter |
When users log on to a workstation in the laboratory, they will see a user login prompt. Type the user name and password respectively.
login: username password: UNIX is a case sensitive operating system. Commands and key words are always in lower case. User name is always in lower case. Make sure the keyboard is not cap locked. If the monitor is off, turn it on. If there is no image display on screen, press a key or move the mouse to invoke the system.
If login process is not accepted, try again in case of mis-typing.
User may remote log on to the system from other machines by the software TELNET. The fully qualified domain addresses of the machines are
| abacus.sci.hkbu.edu.hk | (sc1.sci.hkbu.edu.hk, abacus) | - The compute server |
| beads.sci.hkbu.edu.hk | (sc3.sci.hkbu.edu.hk, beads) | - The file server |
| calculus.sci.hkbu.edu.hk | (sc4.sci.hkbu.edu.hk, calculus) | - The file server |
| www.sci.hkbu.edu.hk | (sc5.sci.hkbu.edu.hk, ftp.sci.hkbu.edu.hk) | - The ftp and WWW server |
| ada.sci.hkbu.edu.hk | (sc11.sci.hkbu.edu.hk, ada) | - The client machines |
| babbage.sci.hkbu.edu.hk | (sc12.sci.hkbu.edu.hk, babbage) | |
| cauchy.sci.hkbu.edu.hk | (sc13.sci.hkbu.edu.hk, cauchy) | |
| einstein.sci.hkbu.edu.hk | (sc14.sci.hkbu.edu.hk, einstein) | |
| fourier.sci.hkbu.edu.hk | (sc15.sci.hkbu.edu.hk, fourier) | |
| gauss.sci.hkbu.edu.hk | (sc16.sci.hkbu.edu.hk, gauss) | |
| hilbert.sci.hkbu.edu.hk | (sc17.sci.hkbu.edu.hk, hilbert) | |
| jacobi.sci.hkbu.edu.hk | (sc18.sci.hkbu.edu.hk, jacobi) | |
| kutta.sci.hkbu.edu.hk | (sc19.sci.hkbu.edu.hk, kutta) | |
| laplace.sci.hkbu.edu.hk | (sc20.sci.hkbu.edu.hk, laplace) | |
| markov.sci.hkbu.edu.hk | (sc21.sci.hkbu.edu.hk, markov) | |
| newton.sci.hkbu.edu.hk | (sc22.sci.hkbu.edu.hk, newton) | |
| pascal.sci.hkbu.edu.hk | (sc23.sci.hkbu.edu.hk, pascal) | |
| runge.sci.hkbu.edu.hk | (sc24.sci.hkbu.edu.hk, runge) | |
| stokes.sci.hkbu.edu.hk | (sc25.sci.hkbu.edu.hk, stokes) | |
| turing.sci.hkbu.edu.hk | (sc26.sci.hkbu.edu.hk, turing) |
The command prompt is different among different shells. % is for C shell. $ is for Bourne shell and Korn shell. The prompt can be set and changed by the system administrator or the user.
When you firstly log on the UNIX system, you will have either no password or an arbitrary password assigned by the system administrator. Neither of them really offers any security. You should change your password by issuing the command passwd. Type
passwd Type your old password Old passwd: Type your new password New passwd: Type your new password again for verification Verify:Then, your password is changed to be the new one.
whoamiThe system displays information similar to the following:
sysadmTo display the login name, the terminal name, and the time of the login, type
who am iThe system displays information similar to the following:
sysadm pts/0 Nov 11 09:30The login name is sysadm, the name of the terminal is pts/0, and this user logged in at 9:30 a.m. on Nov 11.
To display who is log on, type
whoor
fingerTo search for information about a user, type
finger usernameor
finger surname-of-that-userTo display your terminal, type
ttyThe system displays information similar to the following:
/dev/hft0
date
man command man -k commandDisplay a command manual.
For instance, you can type the command man man. Then, the online manual will appear.
To read the next page, press the space bar, type
man manTo read all the commands related to the keyword man, type
man -k man
A pathname that traces the path from the root to a file is called a full pathname. A full pathname provides a complete and unambiguous name for a file.
In a full pathname, the first slash(/) refers to the root of the file system. The last slash separates a file name from the directory names. The other slashes separate the sub-directory names.
Note: The directory separator is denoted by "/" instead of "\" as in DOS.
A single dot "." is used to refer to the current directory (the directory which you are working at).
Double dots ".." are used to refer to the parent directory of the current directory.
"../.." refers to the parent of the parent of the current directory.
Flags further define the actions of commands. A flag is a modifier used with the command name on the command line, usually preceded by a dash.
ls [ options ] namePrint a list of files and sub-directories under the specified directory. It is equivalent to the MS DOS command dir. If no name is specified, the default is the current directory. Wild cards can be used within the specified name.
List the contents of the current directory.
lsList the full contents of the current directory including the dot files.
ls -laList the contents of the root directory.
ls /List the contents of the directory /student under root directory.
ls /studentList the contents of the parent directory of the current directory.
ls ..
cat [ options ] file...Create a file my_file1.
cat > my_file1 Testing! This is my file.Print the content of the file to screen
cat my_file1Redirect the content of a file to another.
cat my_file1 > my_file2Print the contents of one or more files page by page
more file ...Press Spacebar to read the next page.
mkdir directory-name mkdir temp mkdir demonstration
cp [ options ] file1 file2 cp [ options ] file1... directory cp [ options ] directory1... directorynYou may copy a file to another, a list of files to a directory or a directory to another directory.
cp my_file1 temp_file1 cp my_file1 demo/my_file1Copy All files under directory demo recursively to the directory demo1.
cp -R demo demo1
mv [options] name1 name2Rename a directory.
mv demonstration demoRename a file.
mv my_file3 your_file1Move a file to a directory
mv your_file1 demo
rm [options] nameRemove/Delete you_file1
rm your_file1Remove your directory temp and all the files inside the directory
rm -r temp
cd [options] directory-nameWhen you are log on, you are inside your home directory. You may change your current directory to other directories.
Change the current directory to demo.
cd demoChange the current directory to your home directory.
cdChange the current directory to the parent directory.
cd ..
pwd
whereis commandFind all the files that contain the name Mail, type
whereis MailThe system displays information similar to the following:
Mail: /bin/Mail /usr/bin/Mail /lib/Mail.rc /usr/ucb/Mail /usr/lib/Mail.rcList previously entered commands
historyShow user processes.
psShow all processes in the system.
ps -ef
lpr [Options] file lpr -Pprintqueue filePrint text file
lpr -Ppcl postscript_file.psOr
lptxt postscript_file.psPrint PostScript file
lpr -Pps postscript_file.psOr
lpps postscript_file.psSee the status of all the printers
lpstatRemove a print job from a print queue
lprm -Pprintqueue jobnumber
man vivi is one of the most common editors run under the UNIX system. This is the editor bundled in all UNIX systems.
vi filenameThis command starts vi running, reads a file into a file buffer, and displays the file contents.
If the file has already been created, this message will appear:
"filename" ? lines, ? charactersIf the file is new, the message will be:
"filename" [new file]There are two modes in the vi editor: command mode and input mode. In the command mode, keys entered from the keyboard is taken as a command. It allows you to move around in the file, or to change parts of it.
In the input mode, characters entered from the keyboard is interpreted as text input intended to be placed in the current position of the file.
When you run the command vi, you will first be in the command mode. Type i to enter the input mode. Press <Esc> to enter the command mode.
The followings are some useful vi commands:
| Text Insertion | |
| a | Append text after the cursor position. |
| i | Insert text before the cursor position. |
| o | Open a new line below the current line. |
| <Esc> | Stop text operation and return to the command mode. |
| Text Copy | |
| yy | Copy the current line to the file buffer. |
| 2yy | Copy 2 current lines (other number can also be used) to the file buffer. |
| p | Copy the content of the file buffer to the position after the current line. |
| P | Copy the content to the position before the current line. |
| Text Deletion | |
| dw | Delete the current word. |
| x | Delete the current character. |
| dd | Delete the current line. |
| p | Put back the text from the previous delete. |
| Text Replacement | |
| r<Char> | Replace the current character to a specified character. |
| R<string><Esc> | Replace string on the current line. |
| Recover the last change | |
| u | Recover the last change. |
| Paging | |
| <Ctrl f> | Page forward one screen. |
| <Ctrl b> | Page back one screen. |
| <Ctrl d> | Page down half screen. |
| <Ctrl u> | Page up half screen. |
| <Ctrl l> | Reprint current screen (screen refresh). |
| Cursor Positioning | |
| j | Move cursor down one line |
| k | Move cursor up one line |
| h | Move cursor one character left. |
| l | Move cursor one character right. |
| Read and write file | |
| :r filename | Read a file into the file buffer at the current position. |
| :w filename | Write the contents to a file. |
| :1;3w filename | Write line 1 to line 3 to a file. |
| Exiting vi | |
| :wq | Write changes to the current file and quits the edit session. |
| :q | Quit if there is no change. |
| :q! | Force to quit and abandon any change. |
vi my_file4 i - Go to the text mode. Insert text to the new file. This is my file. This is the second line. <Esc> - Go to the command mode. :wq - Save and quit vi.You may use the command cat to display the contents of the file my_file4.
cat my_file4Try vi again to append a line to the file.
vi my_file4 j j - Move cursor 2 lines down. a - Go to the text mode. Append text to the current position. This is the third line. <Esc> - Go to the command mode. :wq - Save and quit vi.Use the command cat to display the contents of your file again:
cat my_file4
You have new mail!!!That means someone has sent you an e-mail (electronic mail). You can read your message and reply under the electronic mail services.
mail ... messages ... &Note that the prompt of mail service is & instead of $. Type ? for help. To read message headers, type
& hChoose a message to read and enter its number.
& 1If it is a long mail, press spacebar to read the next page.
mail person1 ... mail person1@machine-name ... mail person1@address ...
What follows is an example to send an e-mail to a student c0000001.
Type the subject heading. Type the message body. Press
Send an e-mail to a person in Yale University.
If someone wants to send an e-mail to you, he should type
mail c0000001
Subject: testing
It is a test on the mail service.
...
Try to send an e-mail to yourself for exercise.
E-mail to Internet
For sending e-mail to an Internet machine, you have to specify the full
mail address in your command line.
mail username@yale.edu
E-mail from other domains
Our full mail address is sci.hkbu.edu.hk.
mail username@sci.hkbu.edu.hk
Send a file
mail person1 ... < file
Read message headers
Type h after the mail prompt to read message headers.
& h
Reply mail
Type r and the message number you want to reply. Reply the first message.
& r 1
Finish Mail Service
Type q or <Ctrl d> to leave the mail service. Then, you will be returned to the $ prompt:
& q
Redirect Mails from IBM to other machines
Create a file .forward and store the e-mail address where you want to redirect to.
vi .forward
i
username%bc750.bitnet@yale.edu
Or
vi .forward
i
username@math.hkbu.edu.hk
Or
vi .forward
i
username@comp.hkbu.edu.hk
A summary of mail Commands
+ Print the next message
Other e-mail software
elm
pine
We have two other popular e-mail software, elm and pine, downloaded from
public domain site. You may like to try them as well
6. C Programming
cc and xlc (ansi-c) is the C compilers under the AIX system.
cc [ options ] source-file...
xlc [ options ] source-file...
To understand all the options, type
cc
or
xlc
Read the online manual for understanding the details.
man cc
man xlc
You can use any editor to prepare a program. Let us use the vi editor
to write a program to print out a message "Hello!":
vi source.c
a
- Remember a is to append a file.
#include
Compile your source program. An executable file a.out is produced if no
output file name is specified.
cc source.c
If you run the executable file a.out, a statement "Hello!" will be printed.
a.out
The following commands compile the source program source.c to produce an
executable program hello by -o option. Then, try to run the executable
file hello.
cc -o hello source.c
Run hello, and a statement "Hello!" will then be printed on the screen.
hello
7. Fortran
f77 and xlf (ansi-fortran) is the Fortran compilers under the AIX system.
f77 [ options ] source-file...
xlf [ options ] source-file...
To understand all the options, type
f77
or
xlf
Read the online manual for understanding the details.
man f77
man xlf
8. FTP (File Transfer Protocol)
This is the Internet standard high-level protocol for transferring
files from one computer to another.
ftp somewhere.domain
ftp ada.sci.hkbu.edu.hk
or ftp sc11.sci.hkbu.edu.hk
At the ftp> prompt, you can type a number of commands.
ftp Commands
ftp> dir
List current directory.
ftp> cd remote-directory
Change remote working directory.
ftp> lcd local-directory
Change local working directory.
ftp> get remote-file local-file
Get a file from a remote computer to the local computer.
ftp> mget r*
Get all files starting with "r", from remote to local.
ftp> put local-file remote-file
Put a file from the local computer to a remote computer.
ftp> mput l*
Put all files starting with "l", from local to remote.
ftp> ascii
Set file transfer to ASCII mode (default mode). Only ASCII
characters will be transferred.
ftp> binary
Set file transfer to binary. All characters will be passed.
ftp> quit
Exit from ftp service.
9. Modem
There are some modem lines served by ITSC. User may have to apply
directly to ITSC for user account and password.
3411 4933
BUCS05>
may appear if you can connect to the terminal server.
show hosts
To read the help messages, type
help
telnet sc11.sci.hkbu.edu.hk
or telnet sc12.sci.hkbu.edu.hk
...
telnet sc26.sci.hkbu.edu.hk
to connect to one of the 16 client workstations in room R735.
10. Terminal Settings
Terminal Type Descriptions
vt100
DEC vt100 text terminal.
PC terminal is always emulated to vt100 under telnet program.
lft
lft is the default IBM text terminal.
xterm
X windows terminal
aixterm
AIXwindows terminal
Terminal Key
Function Key
Explanation
erase
Ctrl-?
Delete a character
kill
Ctrl-u
Delete a command line
werase
Ctrl-w
Delete a word
quit
Ctrl-\
Quit
stop
Ctrl-z
Stop a process
resume
Ctrl-q
Resume a process eof
Ctrl-d
End of file Change Terminal Settings
Set the character erase key to <Backspace>. Type
stty erase <Backspace>
Set the word erase key to <Del>. Type
stty werase <Del>