bold
type needs to be
replaced by text
of your own, for example the name of the command or topic on which you are
looking for help.
Everything else should be typed literally as given in the examples, using lower- and upper-case as shown. (Almost everything in Unix is in lower-case.)
At the end of each command you must press the Return key.
The commands described below are used for finding out what is happening on the system on which you are currently logged in -- ie the system which appears in the Unix prompt. If you are logged in on langs and want to know what is happening on psych you will have to do a "remote login" to psych, using the command:
rlogin psych
ps
This will usually give a response like this:
PID TT STAT TIME COMMAND 1772 q4 R 0:00 -tcsh (tcsh) 1803 q4 R 0:00 psThis shows that you currently have two processes: the first (tcsh) is the process which is initiated when you login to the Sun; the second (ps) is the process you initiated by giving the
ps
command.
The ps command will tell you if you have left yourself logged
on elsewhere. For example the following listing tells you that you have a
second tcsh process and a Pine process.
PID TT STAT TIME COMMAND 1772 q4 S 0:00 -tcsh (tcsh) 1892 q4 R 0:00 ps 1849 q5 S 0:00 -tcsh (tcsh) 1887 q5 S 0:00 /usr/local/bin/pine3.96
kill command.
You can do this if you have left yourself logged in somewhere else, or if
your screen has frozen on one terminal and you are logged in from another.
For example
kill 1849
will shut down the process whose PID is 1849.
After giving the kill command you should use ps
again to make sure it has worked. If it doesn't work you can use the
-9 switch -- eg
kill -9 1849
Naturally you can only use the kill command to shutdown your own
processes, unless you have super user privileges.
ps
command to modify the way it behaves. For example
ps -af
will give a list with details of all the processes currently active on the
system. Because it is likely to be a long list, you should usually use
the "pipe to more" facility:
ps -af | more
You can also search for particular sorts of process using the
grep command. grep searches for a given string
of characters
within a file. If you "pipe" the output from ps into
grep it will search for a string and only display those lines
on which the string occurs.
For example
ps -af | grep pine
will show you all the people who are using pine on the system:
jmy 359 0.0 0.0 848 0 q9 IW May 2 0:46 /usr/local/bin/pine3.96 wc2 24776 0.0 0.0 836 0 q0 IW May 2 0:41 /usr/local/bin/pine3.96 cdl 1485 0.0 1.8 624 540 q2 S 18:33 0:07 /usr/local/bin/pine3.96 sz 2280 0.0 0.0 692 0 p7 IW 18:51 0:05 /usr/local/bin/pine3.96 pcu 2737 0.0 0.7 32 204 q4 S 19:00 0:00 grep pine igm 1690 0.0 5.3 696 1616 p8 S 18:39 0:09 /usr/local/bin/pine3.96Look in the man pages for
ps for information on the
various columns in this display.
users
You will get a response like this:
adb2 bfw cr14 ef2 igm jmy kd4 ngm1 ngm1 pcu pcu smt2 smvp sz tk6 wc
setenv.
For example, Ingres requires some additions to be made to the PATH
environment variable. These are done with the setup ingres
command.
env command.
For example, use the following sequence of commands to find the value of the PATH environment variable before and after setting up Ingres:
env
setup ingres
env
The "env" command might give more information than can fit on a single screen,
so you should use the "pipe to more" option: env | more
|
Julian Crowe
3rd May 1997 | Simple Unix commands: contents page | IT training page |