Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 ?

share|improve this question

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

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

    
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

3 Answers 3

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.

share|improve this answer

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.

share|improve this answer

To add to the non-OSX information, the service is also deprecated on many flavors of Linux, often replaced with systemd. However, systemd doesn’t use the old init.d system (as that system is really what is being deprecated). If you can’t find any of your rc/service controls on your Linux box try using systemctl.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.