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


 
Thread Tools Search this Thread
Operating Systems Solaris Show complete command on command line when we use 'ps'
# 1  
Old 03-12-2012
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.
Code:
ps -ef | cat
ps -ef | grep imp >/tmp/t1.txt
/usr/ucb/ps -auxw
pargs <pid>
/usr/ucb/ps -aefyl | grep imp

Thanks

Last edited by methyl; 03-12-2012 at 02:08 PM.. Reason: please use code tags
# 2  
Old 03-12-2012
you can try with the -o Option, this is needed to define how ps displays the results

example:
Code:
[testsrv880ps:root] # ps -efo args
COMMAND
/usr/sbin/smbd -D
/usr/lib/sendmail -Ac -q15m
/usr/apache2/bin/httpd -k start
/usr/lib/inet/xntpd
/usr/sbin/rpcbind
/usr/lib/utmpd
/usr/lib/inet/inetd start
/usr/sbin/smbd -D
/usr/lib/saf/ttymon
/lib/svc/bin/svc.startd
/usr/sbin/nscd
/usr/apache2/bin/httpd -k start
/usr/lib/ssh/sshd
splunkd -p 8089 start
/usr/lib/crypto/kcfd
/usr/lib/rcap/rcapd
/usr/sadm/lib/smc/bin/smcboot
/usr/lib/autofs/automountd
/usr/lib/saf/sac -t 300
/usr/apache2/bin/httpd -k start
/usr/lib/nfs/lockd
/usr/lib/nfs/nfsmapid
/usr/lib/autofs/automountd
/usr/lib/nfs/nfs4cbd
/usr/apache2/bin/httpd -k start
....

shows me only the command of a process...
# 3  
Old 03-12-2012
Thanks for replying unfortunately this too hasn't helped..
Any other suggestions ?
# 4  
Old 03-12-2012
what term are you using?
Code:
echo $TERM

# 5  
Old 03-12-2012
Quote:
Originally Posted by mk1216
Thanks for replying unfortunately this too hasn't helped..
Any other suggestions ?
On my Solaris boxes that command prints without truncation. What are you seeing when you execute it?
# 6  
Old 03-12-2012
Have you tried:

Code:
/usr/ucb/ps auxwww

# 7  
Old 03-12-2012
The full command line is only displayed if you own the process or if you have root privilege or equivalent.
You can use
Code:
/usr/ucb/ps -alxww

or, if ucb isn't installed
Code:
pargs <pid>

or even
Code:
pargs /proc/*

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need generic command to get complete running process details

I am on SunOS and Linux I need generic command to get complete process details from which i will eventually extract socket details (listen address and port) ps -ef | ggrep -i server | ggrep -i mydomaindoes not yield a process that should have both the grep entries along with the listen... (8 Replies)
Discussion started by: mohtashims
8 Replies

2. UNIX for Advanced & Expert Users

Find command takes too long to complete

Hi, Below is my find command find /opt/app/websphere -name myfolder -perm -600 | wc -l At time it even takes 20 mins to complete. my OS is : SunOS mypc 5.10 Generic_150400-09 sun4v sparc SUNW,T5440 (10 Replies)
Discussion started by: mohtashims
10 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. Shell Programming and Scripting

Grep command is not search the complete pattern

I am facing a problem while using the grep command in shell script. Actually I have one file (PCF_STARHUB_20130625_1) which contain below records. SH_5.55916.00.00.100029_20130601_0001_NUC.csv.gz|438|3556691115 SH_5.55916.00.00.100029_20130601_0001_Summary.csv.gz|275|3919504621 ... (2 Replies)
Discussion started by: sumit.vedi1988
2 Replies

5. Shell Programming and Scripting

How to use command tail -f & show line number.

Hello Guys, I have created function which is as follow: tail -f filename |grep "Key word" output from this command 19-11-2011 21:09:15,234 - INFO Numbement - error number:result = :11 19-11-2011 21:09:15,286 - INFO Numbement - error number:result = :11 19-11-2011 21:09:15,523 - INFO... (5 Replies)
Discussion started by: ooilinlove
5 Replies

6. UNIX for Dummies Questions & Answers

Can grep command return word instead of complete line

Hi Is there any way GREP command can return word and not complete line. My file has following data: Hello Everyone I am NitinrajSrivastava Hi Friends Welcome VrajSrivastava I am using grep 'raj' which is returning me complete line.However I want only the word having keyword 'raj'. Required... (11 Replies)
Discussion started by: dashing201
11 Replies

7. UNIX for Dummies Questions & Answers

Complete command list/argument using ps

Hi, Using ps, I can't work out what is the right options to use to show full listing of the process or command, can someone please advise what options I should be using? Example output of a "trimmed" process is as below and I know this is not the complete command line that I've executed,... (8 Replies)
Discussion started by: newbie_01
8 Replies

8. UNIX for Dummies Questions & Answers

How do you wait for command substitution processes to complete?

When running a command using the >(cmd) syntax in bash how do you wait for the command to complete before moving on in your script? Here is a simple example: zcat largefile.gz | tee >(wc && echo “HELLO”) > /dev/null # I tried wait, here but it doesn't wait for the process in the subshell.... (8 Replies)
Discussion started by: mrvwman
8 Replies

9. UNIX for Dummies Questions & Answers

Using the Esc key to complete command line typing

Dear Techs, In the past on a different box (HP) I use to be able to complete something I was typing by entering a portion of the filename in the pwd and I would hit the Esc key and it would match the rest of the filename. I did this without understanding how it was setup. Now I am on a new... (1 Reply)
Discussion started by: jxh461
1 Replies

10. UNIX for Advanced & Expert Users

ls -R command but need complete path name on each line

Can anyone help me with the following: I need to traverse subdirectories to create a list of files with the pathname. For example, here's what I get with a simple ls -alR command: /MAIN/data/30007390 dte2>>ls -alR .: total 2 drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 . ... (2 Replies)
Discussion started by: condor4-2
2 Replies
Login or Register to Ask a Question