I tried these commands in terminal:

system_profiler | grep CPU\ Speed

system_profiler | grep Machine\ Model

system_profiler | grep CPU\ Type

but it says:

service: This command still works, but it is deprecated. Please use launchctl(8) instead

so what is the new command ?

link|improve this question
Try launchctl? – Sadface Sep 5 '10 at 1:46
Wouldn't this question be a better fit for superuser? – Dan J Sep 5 '10 at 2:20
feedback

migrated from stackoverflow.com Sep 8 '10 at 0:47

This question came from our site for professional and enthusiast programmers.

2 Answers

Those annoying messages are going to stderr, and the output you want is going to stdout. I tried

system_profiler 2>/dev/null | grep Processor\ Speed

under 10.6.4 and got the output

  Processor Speed: 2.5 GHz

You didn't get any output to stdout because you searched for the wrong strings.

link|improve this answer
feedback

On most *nix-type systems, /sbin/service is a simple shell script that runs something out of /etc/init.d with a minimal environment. It's more-or-less the same thing as saying

/etc/init.d something start/stop/status/whatever

So the common use pattern for /sbin/service is to start, stop, or restart daemons, but launchctl and launchd are the OS X new order for that sort of thing.

In fact, OS X doesn't even have init.d, so it has a compiled binary version of /sbin/service that does ... who knows what?

It looks like system_profiler needs to ask a daemon for status and something you have installed is still running /sbin/service to do so. I don't think there is an easy fix for this, but probably a software upgrade will eventually solve this problem for you.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown