|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
When I use ps -ef it will display the processes but it seems to have a limit as to how many character it prints.
For instance I run a script ABC.pl -arg1 "something" -arg2 "something2" -arg3 "something3" When I do a ps -ef it will display ABC.pl -arg1 "something" But not the rest Please note I just shortened this because I do not want the names of my commands on the forum so I couldn't cut and paste. Is there a limit to how many character it will show and is it possible to display more? Is there another way I can view which processes are running? |
|
#2
|
|||
|
|||
|
yes, ps has an historical limit to 80 chars
but if you use sys5rel4 ps you can say it what you want see the -o option in man pages |
|
#3
|
|||
|
|||
|
Quote:
Can you give me an example? The man pages are confusing me. |
|
#4
|
|||
|
|||
|
Code:
ps -eo"%U %p %c %a" %U - means show the username %p - means show the process pid %c - means show the command %a - show arguments The man page lists all of this, if your system supports this extended feature. |
|
#5
|
|||
|
|||
|
Quote:
I tried that and got: $ ps -eo "%U %p %c %a" ps: unknown output format: -o %U ps: unknown output format: -o %p ps: unknown output format: -o %c ps: unknown output format: -o %a 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 |
|
#6
|
|||
|
|||
|
Quote:
What is sys5rel4??? |
|
#7
|
|||
|
|||
|
sys5rel4 = system 5 release 4 = SVR4
exemple: sun's solaris is SVR4 since 1994 ps -ef gives: UID PID PPID C STIME TTY TIME CMD ps -efocomm,ppid,pid gives: CMD PPID PID note the output ORDER! say, you look for pid of 'abcdef' the traditional way is: ps|grep|grep -v|awk people who realized, you can force 'ps' to give (gratis) an other output uses: ps -efocomm,pid | sed -ne "s/.*abcdef.* //p" (note the space before //p) also 2 commands less for the same result. on a standalone sys, it's irrelevant; on a (big)server making a lot of process-monitoring it's saving cpu-time. sure, when performance is an issue, i will NOT use 'ps' but scan the /proc directory (about 200 times faster). |
|
#8
|
|||
|
|||
|
Not all *nix systems have /proc, nor do they support the -o format option the way I outlined. One of the problems with learning the shell is that different Unix flavors have different command sets - what guggach is saying.
You read your man page - you posted the uuid, etc formats, use them instead of what I showed you. There is a book 'UNIX complete' from Sybex. It actually covers all of the flavors of *nix pretty well. Try finding a copy - it's great for beginners. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Viewing processes running (ps -ef) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|