Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Instead of ps? 1

Status
Not open for further replies.

linsto

Technical User
May 24, 2007
4
SE
Hi!
I run Solaris 9 and /bin/ksh, and I have a problem that ps -ef cut's the "processname", like:

$ ps -ef|grep 11218
root 24683 11218 3 14:21:11 ? 0:25 /usr/sadm/lib/wbem/rds -a -t 30000 -i 1000 -f /var/run/rds_db -m -L /var/tmp/rd
root 11218 1 0 Feb 11 ? 140:23 /usr/java/bin/java -Dviper.fifo.path=/var/run/smc898/boot.fifo -Xmx128m -Djava.


I've seen that it's possible to get the whole name, but what is the command?

Anyone that can help me?

Tanks in advance...
/Linda
 
Hi

If you are interested in only one specific process bothering with [tt]/proc[/tt] may be enough :
Code:
cat /proc/[green][i]11218[/i][/green]/cmdline
See the other files too in the process' directory.

Feherke.
 
Hi, and thanks for quick response!

I tried to use /proc but I dont have the cmdline:

$ ls /proc/8782
as cred cwd lpsinfo lusage map pagedata rmap sigact usage xmap
auxv ctl fd lstatus lwp object psinfo root status watch
$

Any idéas what to do next...?

Best Regards
/Linda
 
Hi

My memory said that Solaris has a [tt]/proc[/tt] similar with Linuxes... Seems it is not completely the same.

Sorry, no more idea.

But one. Look in the man page. My [tt]ps[/tt] has option to override the screen/terminal width.
man ps said:
--cols set screen width
--columns set screen width
Code:
ps -ef --cols 256 | grep 11218

[gray]# or[/gray]

ps -ef --cols 256 -p 11218

Feherke.
 
Hi, thanks again for your quick answear!

But it didn't work though...

$ ps -ef --cols 256 -p 11218
ps: illegal option -- -
ps: unknown output format: -o ls
usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
[ -u userlist ] [ -U userlist ] [ -G grouplist ]
[ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
'format' is one or more of:
user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid
pri opri pcpu pmem vsz rss osz nice class time etime stime
f s c lwp nlwp psr tty addr wchan fname comm args projid project pset
$
$ ps -ef --cols 256 | grep 11218
ps: illegal option -- -
ps: unknown output format: -o ls
usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
[ -u userlist ] [ -U userlist ] [ -G grouplist ]
[ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
'format' is one or more of:
user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid
pri opri pcpu pmem vsz rss osz nice class time etime stime
f s c lwp nlwp psr tty addr wchan fname comm args projid project pset
$
$

Best Regards
/Linda
 
On Solaris, try using the UCB version of [tt]ps[/tt]...
Code:
/usr/ucb/ps -auxwww
It supports the "w" option to print it wider (more info).
 
and ww means arbitrary wide output (= as wide as it needs to be)

so either
ps ww 12118 / ps -ww 12118

or

/usr/ucb/ps ww 12118 / /usr/ucb/ps -ww 12118


(or any other process id)

In UCB ps the dash is optional AFAIK (and on AIX, if you leave it out, ps knows to switch to UCB mode)



HTH,

p5wizard
 
OOHH!!! GREAT!!!!
Thankyou so much!!!

It works just fine:

$ /usr/ucb/ps -ww 9444
PID TT S TIME COMMAND
9444 ? S 17:57 /usr/jdk/jdk1.5.0/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/max/tomcat/conf/logging.properties -mx1200m -Dfile.encoding=ISO-8859-1 -Djava.endorsed.dirs=/max/tomcat/common/endorsed -classpath :/max/tomcat/bin/bootstrap.jar:/max/tomcat/bin/commons-logging-api.jar -Dcatalina.base=/max/tomcat -Dcatalina.home=/max/tomcat -Djava.io.tmpdir=/max/tomcat/temp org.apache.catalina.startup.Bootstrap start
$

I'm so happy, and I can't thank you all enough!
You made my day!
:)

/Linda
 
Hi

Linda said:
I'm so happy, and I can't thank you all enough!
You can. There is a link at the bottom of p5wizard's message for this purpose, just click it ( then click for confirmation too ) :

* [navy]Thank p5wizard
for this valuable post!
[/navy]


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top