Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

May 092009
 

How do I find out zombie process?

Answer

Use this command

# ps aux | awk '{ print $8 " " $2 }' | grep -w Z

It will give something like the following (The number is the zombie's pid)

Z 5938
Z 5485
...

Then we can kill it by using the pid

# kill -9 5938

Mar 262009
 

How to replace multiple strings using sed?

Answer:

If you have multiple strings to replace, you can either using the "-e" option in sed, e.g.

sed -e 's/a/A/' -e 's/b/B/' < old.txt > new.txt

or, you can use a sed script file to store all the replace conditions

e.g. vi replace.sed

s/a/A/g
s/b/B/g
s/c/C/g

and execute like

sed -f replace.sed < old.txt > new.txt