Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I run commands in terminal a lot and i'm wondering if it is possible to run the commands from spotlight. For example in spotlight would like to run the command(because i have a lot of network issues):


And then spotlight to load terminal and execute the command instead of having to load terminal because it takes so long to load. So is this possible?

share|improve this question
Just have Terminal open in the background at login if you don't like the load time. – Nathan Greenstein Apr 18 '11 at 14:38
@Nathan I can't afford it RAM is limited on my machine as I only have 2GB on the machine that needs it most of the time. Im really just trying to make myself lazy. As i've already added a link from Safari to sad for typing mistakes. – Dean Apr 18 '11 at 14:43
2GB should be enough for Terminal so if it is slow to start there could be other reasons - e.g. things in your shell start up scripts e.g. .profile – Mark Apr 18 '11 at 14:56
No OSX has serious memory issues. Especially when you don't clean up your system regularly, I would if I had time to do this but my main machine is in use 24/7. – Dean Apr 18 '11 at 15:36
Terminal uses a minuscule amount of RAM. If it's doing otherwise there's something wrong with your system. Right now it's using less than: a) a single Google Chrome tab, b) Skype, c) Adium, d) Finder. You may want to look at Visor to see if it suits your needs. – boehj May 6 '11 at 14:40
up vote 5 down vote accepted

Just a heads up that Alfred app now has both global hotkeys which allows you to launch apps/commands/applescripts with a key combo, as well as Terminal/Shell integration, which lets you run any Terminal command without launching Terminal.

For example, create a script to auto-shorten a URL using then copying it to clipboard (here's how you can do that). Or launch any terminal command (e.g. ping to pop up a Terminal window.

It's part of the Powerpack and is in pre-release right now, going to general availability next week :)

Vero (community gal for @alfredapp)

share|improve this answer
+1 because I love Alfred. – ConstantineK May 6 '11 at 15:46
this is a paid only feature.. -1 b/c you gave an answer that requires $$ for a question asking for a solution that doesn't – abbood Apr 27 at 11:25

It's not possible through Spotlight itself.

But it's possible through free applications that can also search files and launch programs, like Spotlight.

You have the almighty Quicksilver, that can also make coffee and walk the dog.

And the new player Alfred, which is quite impressive as well.

share|improve this answer

Not directly but write the commands you want in a shell script and save the script with a .command extension and chmod it so it is executable. This is clickable from Finder and so should work from spotlight

share|improve this answer
But you would have to do this prep for every different command you wanted to run with Spotlight? – Nathan Greenstein Apr 18 '11 at 15:19
Can a .command script get a dropped file as argument in a $1 variable, for example? – Petruza May 30 '11 at 19:20
Great answer, which is also at… – Philip Durbin Oct 31 '13 at 14:09

I use both DTerm and Alfred. DTerm is very nice for the occasional quick command or even a man page as its results window expands to fill the screen and scroll if necessary. A simple ESC dismisses the results.

share|improve this answer
+1 for DTerm. A lot of people don't know about it, yet it works so well. Also note it is in the Mac App Store – styfle May 6 '11 at 16:49

This is possible with Flashlight ( Flashlight is an unofficial api to spotlight and offers a plugin ( to run terminal commands right inside spotlight.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.