Problem listing processes


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem listing processes
# 1  
Old 01-19-2012
[Solved] Problem listing processes

hi!
i wrote this script(ubuntu os):
Code:
clear

echo "number of running processes"

ps -ef | wc -l

but i can't get the number of my currently running processes...
is there a way to see HOW MANY processes are running to my system?

---------- Post updated at 11:20 PM ---------- Previous update was at 11:19 PM ----------

sorry i forgot exit 0 at the end of the script

Last edited by radoulov; 01-19-2012 at 05:21 PM.. Reason: Code tags!
# 2  
Old 01-20-2012
Strictly speaking it would be:
Code:
ps -ef | grep -v "UID" | grep -v "defunct" | wc -l

# 3  
Old 01-20-2012
Or, the wc -l part can be embedded into grep:

Code:
ps -ef | grep -v "UID" | grep -vc "defunct"

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Processes problem - Need help

Hello, I can't figure out how to solve this problem. I know that is not something very difficult, but it doesn't work for me. Any help is important for me, thank you! For each command line argument, the main process will launch one subprocess. Each such process will establish if the assigned... (1 Reply)
Discussion started by: Ruinum
1 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Problem with listing my files

Hello, In my directory i have got a list of files like below unix1a.csv unix1b.csv unix1c.csv unix1d.csv unix1y.csv I have done ls -lrt unix1.csv, how can i get my unix1y.csv also get listed along with this.. (5 Replies)
Discussion started by: sathyaonnuix
5 Replies

3. HP-UX

listing processes older than n days

Hello; trying to find processes older than n days, mostly user shells Tried the following code on 11.31 box: in this case older than 5 days UNIX95= ps -ef -o user,pid,ppid,cpu,etime,stime | grep "-" | awk '{print $2}' | xargs ps -ef|grep -v '?' |\ awk '$5 !~ ""' | awk '($5 ~ "$(date "+%b")")... (6 Replies)
Discussion started by: delphys
6 Replies

4. Shell Programming and Scripting

Listing processes that are a day older

Hi All, I am trying to automate some stuff to make my 'to-do-things' easier. I am in need for help regarding this. I have an output root 17187 3465 0 23:00:00 ? 0:01 Process1 root 4975 4974 0 May 12 ? 0:00 Process2 root 4042 16713 0 Jan 30 pts/22 0:00... (4 Replies)
Discussion started by: reddybs
4 Replies

5. Solaris

Listing processes with swap usage

Is there any way to get list of processes which are taking maximum swap , my system is showing no swap space in /var/adm/messages and i 'm unable to pin down the process which is consuming max swap space. (11 Replies)
Discussion started by: fugitive
11 Replies

6. UNIX for Advanced & Expert Users

wiered problem in listing the file

Hi All , I am having a set of file, when i list like ls -l *filename* it is listing all file. If is do ls -l filename.ext it is not listing the file. I dodnt know what will be the cause Example: $ ls -l *13712.* ---- listing in wild card worked total 136864 -rw-r--r-- 1 p68 sup... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

7. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

8. Shell Programming and Scripting

Find problem listing directories even -type f

Hi All, #!/bin/ksh find /home/other -ls -type f -xdev | sort -nrk7 | head -2 >bigfile.txt The above is my script, which writes the large file into a file called bigfile.txt. My script contains only the above two lines. after execution i am getting the output like find: cannot chdir to... (1 Reply)
Discussion started by: Arunprasad
1 Replies

9. Shell Programming and Scripting

processes problem...

The called program gets as parameters two or more integers and and returns 0 if all pairs of two are relatively primes, and 1 otherwise. The callee shall read a sequence of numbers and tell whether they two by tworelatively primes. (1 Reply)
Discussion started by: baku
1 Replies

10. Shell Programming and Scripting

problem with listing of directory structure

Hi When im listing (ls -al ) its listing directories without / at the end of directories dir1 dir2 dir3 and i need to list directories with dir1/ dir2/ dir3/ and this should not be made by command ls -F / should be embedded at the last since one of the scripts reads directories... (1 Reply)
Discussion started by: vasanthan
1 Replies
Login or Register to Ask a Question