PHY102 - Linux Help
The computers in 1240BPS run the Linux operating system. Linux is a form
of the Unix operating system which runs on pc's and it is popular,
because it works well and it is FREE. Unix is the most widely used operating
system on workstations, whereas MS Windows is still the most widely used
system on pc's.
Your account
Your account name and initial password will be given
to you on a piece of paper at the start of the first laboratory session.
-
Your first job is to change the password to something nontrivial that you
will not forget. To do this, you need to send the command yppasswd to the
linux operating system. To send commands, you first open a terminal
window by right-clicking on the desktop, or by clicking on the Applications
menu and then clicking on accessories.
Some useful Linux commands
-
"mkdir <directoryname>" creates a new sub-directory named <directoryname>
-
"cp <file1> <file2>" copies <file1> to <file2> where
<file2> can be a new filename or a directoryname. e.g., "cp *
backup" will copy everything in the current directory to the subdirectory
named "backup", if backup has already been created as a subdirectory.
Note: cp is a safe command in that it leaves copies of the files at the
original location and doesn't delete them. However, it will overwrite
files so if you copy a file to a new name and a file of that name already
exists, it will be obliterated!
-
"cd <directoryname>" moves you to directory <directoryname>
-
"pwd" tells you what directory you are in
-
"ls" tells you what is in your directory
-
"rm <filename>" deletes <filename> BEWARE of rm, for example
"rm * " deletes everything in your directory!
-
"man <utilityname>" gives (rather formal) help on utility <utilityname>.
(e.g., try "man ls"). After accessing a "manual" page your terminal
gets reformatted. To scroll through the pages hit "spacebar".
To exit and get back the command line hit "q".
Run mathematica
To run mathematica type at the command line "Mathematica &". The ampersand "&"
starts mathematica as a separate process and gives you your command line back.
To run the example program, save a copy of it on your Desktop
(using the Save command that you will find on the File menu of
your browser). If you save it with the name Worksheet0.nb, then
you can run it in Mathematica by entering the command
Mathematica Worksheet0.nb
Mathematica
Completing assignments
Complete assignments by typing information into your Mathematica
notebook on the screen. Periodically save the notebook.
Click ``save'' which is under ``file'' in mathematica toolbar.
It will save the file to the current directory under the linux operating
system (give it a better name that ``untitled''!!). To ensure that you
have succeeded, use the "file manager", or return to your ``terminal''
window and type ``ls'', to make sure that it is there. Saved notebooks
can be reopened in Mathematica from the "file" menu. An assignment
is completed when you have completed all the questions on the worksheet,
and have handed in a printed copy.
Print your worksheet
To print your file, Click ``print'' under ``file'' in the mathematica toolbar.
Then choose ``file''. This will save your file as a postscript file (again
give it a better name that ``untitled''). Then return to the terminal window
and type ``ls'' to check that it is there. Now type ``lpr filename.ps''
and your file will be printed on the printer in BPS1240.
You can launch a window-based help system from the applications menu.
Another way to print a file:
you can use the unix command
lpr filename
or you can open the file in gedit and use that editor's
print option.
Customize unix
You may find it convenient to append the lines
set history = 32
alias h 'history'
alias rm 'rm -i'
to the file .cshrc in your home directory. Then h displays the last 32
commands you entered, and rm asks for confirmation before deleting a file.
If you plan to stay in a technical field such as physics or engineering
you will benefit from learning more about the unix operating system and
a nice
unix manual
is available online.
Time to go home, just for today...
To end your session and log out:
1) first save everything that you don't want to lose
2) close all your applications. Strictly speaking you don't have
to do this, but you will find things you forgot to save this way and won't
lose them!
3) log out: click on the "start" button, the icon on the bottom left of the screen.
Holding down the mouse button, drag to "log out" and let go the button.