SunQuest
           UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old September 1st, 2004, 10:41 AM
smiles78 smiles78 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 46 smiles78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 33 sec
Reputation Power: 5
Exclamation Viewing processes running (ps -ef)

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?

Reply With Quote
  #2  
Old September 1st, 2004, 12:01 PM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 44 m 45 sec
Reputation Power: 9
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

Reply With Quote
  #3  
Old September 1st, 2004, 01:08 PM
smiles78 smiles78 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 46 smiles78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 33 sec
Reputation Power: 5
Quote:
Originally Posted by guggach
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


Can you give me an example? The man pages are confusing me.

Reply With Quote
  #4  
Old September 1st, 2004, 02:00 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,307 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 28 m 57 sec
Reputation Power: 48
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.

Reply With Quote
  #5  
Old September 1st, 2004, 02:30 PM
smiles78 smiles78 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 46 smiles78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 33 sec
Reputation Power: 5
Quote:
Originally Posted by jim mcnamara
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.


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

Reply With Quote
  #6  
Old September 1st, 2004, 02:41 PM
smiles78 smiles78 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 46 smiles78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 33 sec
Reputation Power: 5
Quote:
Originally Posted by smiles78
Can you give me an example? The man pages are confusing me.


What is sys5rel4???

Reply With Quote
  #7  
Old September 2nd, 2004, 04:45 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 44 m 45 sec
Reputation Power: 9
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).

Reply With Quote
  #8  
Old September 2nd, 2004, 09:14 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,307 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 28 m 57 sec
Reputation Power: 48
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Viewing processes running (ps -ef)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway