vaibhavmishra062201
asked on
getting full command text through ps while process is running
hi,
i need to check whether a java program i executed is already running.
for this i used "ps -af" command, but it does not gives me full command text which i typed.
it gives me the following -
$ ps -af
UID PID PPID C STIME TTY TIME CMD
capadm 4372 4356 0 11:45:44 pts/4 0:00 vi scheduler.sh
capadm 4380 4375 0 11:46:54 pts/5 0:22 /usr/bin/../java/bin/../jr e/bin/.
./bin/sparc/native_threads /java beans/general/
root 4684 4394 0 12:48:25 pts/6 0:00 ps -af
note that java file name is missing after package "beans/general/".
how can i get full command text ?
thanx
vaibhav
i need to check whether a java program i executed is already running.
for this i used "ps -af" command, but it does not gives me full command text which i typed.
it gives me the following -
$ ps -af
UID PID PPID C STIME TTY TIME CMD
capadm 4372 4356 0 11:45:44 pts/4 0:00 vi scheduler.sh
capadm 4380 4375 0 11:46:54 pts/5 0:22 /usr/bin/../java/bin/../jr
./bin/sparc/native_threads
root 4684 4394 0 12:48:25 pts/6 0:00 ps -af
note that java file name is missing after package "beans/general/".
how can i get full command text ?
thanx
vaibhav
PS just doesn't do that for you. You could, however, get it out of /proc.
If you are on Solaris 9 you can use the pargs <PID> command to show all the arguments supplied to a process (and pargs -e to show environment variables)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
tfewster is correct. ps will only show 80 columns. using /usr/ucb/ps with the -w option increases the size to 132 columns while -ww uses arbitrarily wide output.
vaibhavmishra, I'm pleased I answered your question, but may I ask why you gave my comment that grade? If you need any further information, I would be happy to provide it.
You may find these tips on grading useful: http://www.cityofangels.com/Experts/Closing.htm#7
Regards,
tfewster
You may find these tips on grading useful: http://www.cityofangels.com/Experts/Closing.htm#7
Regards,
tfewster