Run a command on a remote machine

ssh user@host "ps aux | grep httpd | wc -l"
This counts the number of httpd processes running.
Sample Output
36

2
By: root
2009-01-27 00:46:17
ssh

What Others Think

Actually, that line would count the number of httpd processes running... plus one. To count foo processes reliably, try pgrep foo | wc -l FWIW, if you *need* to use grep, you can also avoid the spurious line using ps aux | grep foo | grep -v grep | wc -l HTH.
laburu · 639 weeks and 3 days ago
'ps aux | grep [f]oo' is better and shorter than 'ps aux | grep foo | grep -v grep'
leper421 · 635 weeks and 6 days ago
house cleaning medford oregon Thank goodness I found this page!
yeoyeo · 25 weeks and 2 days ago
awesome. learned alot. keep posting more tape extensions
looneyhans · 11 weeks and 4 days ago
I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! ??
KayGasaway · 9 weeks and 4 days ago
Recruitly® is built to streamline Recruiting agency software processes and help businesses grow as a result. Recruiting agency software
KayGasaway · 8 weeks and 6 days ago
Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I’m happy to find so many useful info here in the post, we need work out more techniques in this regard, thanks for sharing. ??
KayGasaway · 8 weeks and 6 days ago
Super-Duper site! I am Loving it!! Will come back again, Im taking your feed also, Thanks. ???????
KayGasaway · 8 weeks and 1 day ago
You've completed in excellent work. t suggest to my frtends ind personilly wtll certitnly dtgtt. t'm conftdent they'll be gitned from thts webstte. Colin Farell Tracksuit
KayGasaway · 8 weeks and 1 day ago
Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I’m happy to find so many useful info here in the post, we need work out more techniques in this regard, thanks for sharing. https://www.signinsupport.net/
KayGasaway · 8 weeks ago
All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks ipl
hiknigarde · 7 weeks and 6 days ago
Wonderful blog! I found it while surfing around on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Appreciate it. ??? ???
KayGasaway · 7 weeks and 4 days ago
Simple Moving Company established to provide stress free moving services. We are fully licensed and insured full service local and long distance moving company. Our goal is to provide excellent customer service, fast deliveries and successful relocation to all our customers. We know moving isn’t easy and a very stressful event and we make sure that you will have a SIMPLE move. To arrange movers, please contact us at your convenience. We look forward to meeting you soon. HEADQUARTER ADDRESS 1919 VINEBURN AVE, STE 04, LOS ANGELES, 90071 [url=https://www.simplemoving.us/]commercial moving services[/url]
markcooper · 7 weeks and 1 day ago
Boston Pool Remodeling and Construction | New Hampshire and Boston Commercial Pool Remodeling, Repair, Construction | Affordable Boston Pool Plastering, Pebble Tech, Pebble Pool Plastering, Diamond Brite Quartz Pool Plastering Pool Restoration Boston
KayGasaway · 7 weeks ago
You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! http://www.mrbeanbag.co.uk/the-walmarts-strategy-perfect-and-not-so-perfect-onewalmart-wire-login/">wmlink/2step
KayGasaway · 6 weeks and 4 days ago
I'm constantly searching on the internet for posts that will help me. Too much is clearly to learn about this. I believe you created good quality items in Functions also. Keep working, congrats! online marketing agentur
KayGasaway · 6 weeks and 3 days ago
Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. The Float Life
KayGasaway · 6 weeks and 2 days ago
I'm constantly searching on the internet for posts that will help me. Too much is clearly to learn about this. I believe you created good quality items in Functions also. Keep working, congrats! cheapest PCB
KayGasaway · 6 weeks and 1 day ago
Reliable Service For 100% Pool Enjoyment Contact us today for a free estimate for your pool repair, remodeling, or new construction needs both residential and commercial. Pool Construction Service
KayGasaway · 6 weeks ago
Cash App Help made simple for everyone who wants to speak to a member of the cash app customer service team on phone. Get a reliable cashapphelp number now. http://bestarticle.unblog.fr/2021/03/27/a-great-online-payment-entry-tends-to-make-payment-running-easy-and-quick/">Cash Business Number
ayesha · 6 weeks ago
How can we recognize that it is PU Leather or Real Leather What is PU Leather What is the Difference bw PU Leather and Real Leather, We have all answers in details, Please visit our website to get the best & honest information for all kind of leathers. PU leather
KayGasaway · 5 weeks and 6 days ago
This is a great high resolution screen which you have shared for the users. Making a website is not an easy task but managing a good website is really a hard work. As far as this website is concerned, I am very happy. http://www.wintermode.ca">winter tires kanata
KayGasaway · 5 weeks and 3 days ago
Xander Technology Solutions | Video Marketing Service | Digital Marketing Agency digital marketing solutions
KayGasaway · 5 weeks and 1 day ago
definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! Flightfins
KayGasaway · 5 weeks and 1 day ago
Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. Managed IT Support companies Rancho Park Los Angeles, California
KayGasaway · 4 weeks and 4 days ago
Sky Marketing strives to be Pakistan's biggest real estate developer ever, guaranteeing the highest international standards, prompt execution, and lifetime customer loyalty. With projects like park view city islamabad plots for sale 
hiknigarde · 4 weeks and 3 days ago
Buy Pharmacy grade drugs to boost stamina and enhance performance. Buy HGH, mens sexual health products, weight loss remedy, EPO and Clenbuterol Buy Online. Clenbuterol for sale
hiknigarde · 4 weeks ago
Affordable Pools Inc. Pool Remodeling | Pebble Plaster. Tile and Coping, Decking; Indoor Pools, Spa and New Pool Construction! Boston Gunite Pool Renovations | Whether your residential pool needs a refresh, or you’re a commercial pool owner in need of a complete redesign, Affordable Pools is your only source for pool repair and remodeling in Boston, Massachusetts, Rhode Island, Vermont, Maine, Connecticut, ;and all across New England. Affordable Pools is ready to help you make your pool look brand new. Contact us today for a free estimate for your pool repair, remodeling, or new construction needs both residential and commercial. travertine pool coping
KayGasaway · 3 weeks and 6 days ago
Over 2134+ students already improved their performance using the Class Companion Try us for free today, and understand why complex attendance is a thing of the past. http://criticoll.com/">Free Attendance Software
KayGasaway · 3 weeks and 4 days ago
Home Inspection Columbus Ohio by HC Inspectors - Results Driven! Professional home inspectors We provide new construction, mold, radon, lead paint inspections and more! Please visit our website for Home and Commercial Property Inspection Services. Home Inspection Columbus Ohio
ayesha · 3 weeks and 3 days ago
[https://www.infobrez.com/campaign-management-software](thannks)
gangathara · 3 weeks and 2 days ago
Campaign Management Software
gangathara · 3 weeks and 2 days ago
Healing touch is a truly needed element to better mental health. With massage we can work out the tensions in the muscles that you tighten in anxious moments, and the aches that come from depression. http://www.simpleempathykc.com/">mental health wellness center
KayGasaway · 3 weeks and 2 days ago
We have been selling potency drugs continuously since 2008. We are familiar with this industry not only from the side of the trends prevailing on the market, but above all from the biochemical and pharmaceutical side. Kamagra apteka
ayesha · 3 weeks ago
I think that thanks for the valuabe information and insights you have so provided here. Judi mpo
mohsinkhatri · 2 weeks and 5 days ago
At Quick Buffet we're more than just a directory. Actually we're not a directory. Office Buffet food Delivery Birmingham
KayGasaway · 2 weeks and 2 days ago
Welcome to Altered Carbon's fan page where we connect with working dog enthusiasts and share our journey from puppy to adult using positive reinforcement to train black russian terriers to be protection dogs / guard dogs. http://www.facebook.com/altrdcarbon">Altered Carbon
KayGasaway · 1 week and 3 days ago
HOVERBOARD UK: Buy British HOVERBOARDS UK for Sale and get next day Free Delivery.
KayGasaway · 1 week and 1 day ago
One present why galore businesses opt for postcards is because they are overmuch cheaper to be prefab and this can forbear a lot of expenses on the lengthened run. royal online
KayGasaway · 1 week ago
The process described in this article will work for various scopes of redesign — from a feature or view level to full application redesigns. These recommendations will help you avoid pitfalls and deliver value fast, and are based on the experience we gained from hundreds of redesigns, bumps, and bruises along the way. https://spdload.com/blog/how-to-redesign-an-app/. Design quality can play a crucial role in your product’s success. So, it is definitely necessary to invest in its development.
Latricia31 · 1 week ago
The process described in this article will work for various scopes of redesign — from a feature or view level to full application redesigns. These recommendations will help you avoid pitfalls and deliver value fast, and are based on the experience we gained from hundreds of redesigns, bumps, and bruises along the way. [url=https://spdload.com/blog/how-to-redesign-an-app/]https://spdload.com/blog/how-to-redesign-an-app/[/url]. Design quality can play a crucial role in your product’s success. So, it is definitely necessary to invest in its development.
Latricia31 · 1 week ago
[spdload.com/](https://spdload.com/)
Latricia31 · 1 week ago
Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. terpinator
KayGasaway · 1 week ago
A digital workplace is a cloud based work platform that lets businesses move work to the virtual space. https://www.infobrez.com/digital-workplace-software
gangathara · 6 days ago
Kotak FASTag recharge and Fastag charges, fees how to apply and recharge with Kotak bank app and benefits of using fastag program Kotak Fastag
KayGasaway · 6 days ago
Whoi, excellent, t wondered just how to cure icne. ind found your webstte by google, dtscovered todiy t'm i ltttle obvtous i greit deil. t’ve ilso idded RSS ind sive your webstte. keep us updited. Buy Wedding Cake marijuana Online
KayGasaway · 4 days ago
Persons appreciate shopping for amazing, appealing, fascinating and from time to time attractive aromas for them selves and pertaining to others. This can be executed conveniently along with inexpensively in an on-line perfume shop. San Diego Fitness
KayGasaway · 4 days ago
With over 40 years of experience within our Senior Management alone, we have some of the most experienced department heads within the security industry whose philosophy is quite simply, Security Guards Middlesbrough
KayGasaway · 4 days ago
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. royal slot
jackson2321 · 3 days ago
Monogrammed Backpack Diaper Bag - Lavington Designs LLC The perfect monogram baby bags & diaper bag for the perfect momma, roomy, functional, stylish and shop with us and get FREE monogramming.
KayGasaway · 2 days ago
good website hope you see my mpo site too https://menara368mpo.wildapricot.org/
menara368 · 20 hours ago
Persons appreciate shopping for amazing, appealing, fascinating and from time to time attractive aromas for them selves and pertaining to others. This can be executed conveniently along with inexpensively in an on-line perfume shop. Aurélien Bleriot
jackson2321 · 20 hours ago
Persons appreciate shopping for amazing, appealing, fascinating and from time to time attractive aromas for them selves and pertaining to others. This can be executed conveniently along with inexpensively in an on-line perfume shop. Aurélien Bleriot
jackson2321 · 20 hours ago
All of our growers follow the strictest guidelines. No pesticides, long curing times and all strains are tested in house to ensure that you receive the highest quality. Marijuana for sale
KayGasaway · 15 hours ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: