[ILUG] Command-line output and screen width: ps aux | grep puzzle
cmcclean at ait.ie
Thu Feb 15 09:32:22 GMT 2001
I'm teaching an introductory course on Linux, with an emphasis
on system administration.
We've been examining basic process management in class, the most
immediate application being killing a non-responding process (e.g.
netscape). So the steps are as follows:
1. Run netscape from /usr/local/netscape/netscape
2. Run ps aux | grep netscape
3. Identify the PID from the output and then kill the process.
However, I was puzzled when I tried this: netscape wasn't showing
up in response to
ps aux | grep netscape
So I just ran ps aux on its own, and I get
(process details) ......./usr/local/netsca
i.e. the command line name has been truncated, so grep is not picking
up netscape from the output of ps aux. Now, it will work if I tell
grep to look for netsca, i.e.
ps aux | grep netsca
but this isn't satisfactory when teaching beginners - "you can't enter
the whole name of the program, just the first part of it".
What if the command-line path was longer, and the executable was
omitted entirely from the output of ps aux? e.g.
The reason for this seems to be that the default terminal setting is
for 80 characters width; is it possible to increase this, or is there
a better way to approach this problem?
Running Mandrake 7.1 by the way.
Thanks in advance,
More information about the ILUG