Complete command list/argument using ps


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Complete command list/argument using ps
# 8  
Old 09-28-2010
Hi all,

Thanks for all the tremendous response ... My apology for not mentioning that the OS is Solaris.

/usr/ucb/ps -auwwwx does the trick although pargs is very helpful too. Unfortunately as some of you had mentioned, the command is OS dependent so while /usr/ucb/ps -auwwwx works in Solaris, it does not on HP-UX ...Smilie grrrr ....

I know am asking for some sort of miracle here, but is there an equivalent of the /usr/ucb/ps -auwwwx command that will work across all or most UNIX flavours?

Sample output of the /usr/ucb/ps -auwwwx output as below:

Code:
# /usr/ucb/ps -auwwwx | more
USER       PID %CPU %MEM   SZ  RSS TT       S    START  TIME COMMAND
root      7883  0.1  0.2117152113296 ?        S   Sep 08 521:59 /usr/lib/cacao/me/cdc/bin/cvm -Xmx128M -Dcom.su
n.management.jmxremote -Dfile.encoding=utf-8 -Djava.endorsed.dirs=/usr/lib/cacao/lib/endorsed -Xbootclasspath/a
:/usr/lib/cacao/me/support_lib/logging.jar:/usr/lib/cacao/me/support_lib/j2me_xml_ri.jar -Djava.class.path=/usr
/lib/cacao/me/support_lib/jmxremote.jar:/usr/lib/cacao/me/support_lib/sunsasl.jar:/usr/lib/cacao/me/support_lib
/jdmkrt.jar:/usr/lib/cacao/me/support_lib/sasl.jar:/usr/lib/cacao/me/support_lib/jmx.jar:/usr/lib/cacao/me/supp
ort_lib/jmxremote_optional.jar:/usr/lib/cacao/lib/cacao_cacao.jar:/usr/lib/cacao/lib/cacao_j5core.jar:/usr/lib/
cacao/lib/bcprov-jdk14.jar -Djavax.management.builder.initial=com.sun.jdmk.JdmkMBeanServerBuilder -Dcacao.print
.status=true -Dcacao.config.dir=/etc/cacao/instances/scn-agent -Dcacao.monitoring.mode=smf -Dcom.sun.cacao.ssl.
keystore.password.file=/etc/cacao/instances/scn-agent/security/password com.sun.cacao.container.impl.ContainerP
rivate



---------- Post updated at 08:45 PM ---------- Previous update was at 08:42 PM ----------

Quote:
Originally Posted by rdcwayx
with root or PID owner.
Code:
/usr/ucb/ps -auwwwx

Hi,

So far, you have the best answer Smilie

I know am asking for some sort of miracle here, but is there an equivalent of the /usr/ucb/ps -auwwwx command that will work across all or most UNIX flavours?
# 9  
Old 09-29-2010
There is no variant of the "ps" command which gives the full command arguments (you get as much as the kernel chooses to record) and no syntax which is common across all unix variants.

The nearest you'll get from HP-UX is to invoke the alternative format for "ps" by using "UNIX95= " and ask for the extended arguments list. Note that the space character after the equals sign is important.
For example to show Process ID, User, Extended arguments:
Code:
UNIX95= ps -exo pid,user,args

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Specifying a list name as argument and using that list in script.

Is there a way I can specify the name of a list as an argument to a shell script and then use the values of that list name in the script? I need to do this WITHOUT using case statements. Something like this: check.sh list1 #!/bin/bash list1="www.amazon.com www.google.com"... (9 Replies)
Discussion started by: gctaylor
9 Replies

2. Shell Programming and Scripting

Argument list too long

Hi Team, Here's the situation. I have approximately 300000 to 500000 jpg files in /appl/abcd/work_dir mv /appl/abcd/work_dir /appl/abcd/process_dir The above move command will work if the jpg files count is close to 50000 (not sure). If the count is less this mv command holds good. But if... (14 Replies)
Discussion started by: kmanivan82
14 Replies

3. Shell Programming and Scripting

In Shell Script Does Second Command Wait For First Command To Complete

Hi All, I have a question related to Shell scripting. In my shell script, I have following two commands in sequence: sed 's/^/grep "^120" /g' $ORIGCHARGEDAMTLIST|sed "s;$;| cut -f$FIELD_NO1 -d '|' | awk '{ sum+=\$1} END {printf (\"%0.2f\\\n\", sum/100)}' >$TEMPFILE mv $TEMPFILE $ORIGFILE... (3 Replies)
Discussion started by: angshuman
3 Replies

4. Solaris

Show complete command on command line when we use 'ps'

Hi, When I query using ps -ef, the complete command is not displayed and is truncated. Can you please tell me a method to resolve this ? I have tried the below. ps -ef | cat ps -ef | grep imp >/tmp/t1.txt /usr/ucb/ps -auxw pargs <pid> /usr/ucb/ps -aefyl | grep imp Thanks (11 Replies)
Discussion started by: mk1216
11 Replies

5. Shell Programming and Scripting

Argument list too long for date command

Dear Friends, The following script processes a 14508 lines log file. #!/bin/sh while read line do d=`sed 's/* - * \*\/*\/* *\)\] .*/\1/' | tr '/' ' ' | sed 's/\(*\):\(*\)/\1 \2/'` y=`date -d "${d}" "+%Y%m%d%H%M%S"` echo "${y}" done While running the above script, I am... (4 Replies)
Discussion started by: tamil.pamaran
4 Replies

6. UNIX for Dummies Questions & Answers

Argument list too long for Sed command

Hi guys Following command results in sed -i 's/#/\\#/g' /home/test/sqlstents* -bash: /bin/sed: Argument list too long Please help me solve it.. is there any other way i can do this?.. thanks (4 Replies)
Discussion started by: depakjan
4 Replies

7. Shell Programming and Scripting

Cannot compare argument in if statement in csh/grep command if argument starts with “-“

If ($argv == “-debug”) then Echo “in loop” Endif But this is not working. If I modify this code and remove “-“, then it works. Similarly I am getting problem using grep command also Grep “-debug” Filename Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies

8. Shell Programming and Scripting

How Get Complete Date in List of file

Hi, I am unable to get the complete date format in ls command. I need to list file with complete date format in home directory. If I give 2007/01/01 then i should get all the log files below that particular date. Pls help me (2 Replies)
Discussion started by: Satyak
2 Replies

9. Shell Programming and Scripting

assign a command line argument and a unix command to awk variables

Hi , I have a piece of code ...wherein I need to assign the following ... 1) A command line argument to a variable e.g origCount=ARGV 2) A unix command to a variable e.g result=`wc -l testFile.txt` in my awk shell script When I do this : print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies

10. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies
Login or Register to Ask a Question