Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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):

ping google.com

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
1  
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
add comment

4 Answers 4

up vote 4 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 goo.gl then copying it to clipboard (here's how you can do that). Or launch any terminal command (e.g. ping yahoo.com) 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. –  hobs May 6 '11 at 15:46
add comment

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
add comment

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 stackoverflow.com/questions/2877741/… –  Philip Durbin Oct 31 '13 at 14:09
add comment

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.

http://decimus.net/DTerm/

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 itunes.apple.com/us/app/dterm/id415520058?mt=12 –  styfle May 6 '11 at 16:49
add comment

Your Answer

 
discard

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.