5

I need to know if there is a terminal replacement for Mac which allows me to store frequently used or long command snippets.

e.g. this one: netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1

this is quite long to type again and again and also quite hard to remember

So I would prefer to just store them in software itself.

migrated from stackoverflow.com Oct 10 '10 at 15:15

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

8

Why not simply use bash aliases, then your shortcuts are available no matter what terminal software you use?

See http://www.hypexr.org/bash_tutorial.php#alias for some tips!

  • 2
    You can also make your history reasonably large and then just use Control-R to recall command lines. – Paul R Oct 9 '10 at 17:20
  • What if you have e.g 50 of such commands ? It's a quite long list to remember even shortcuts of them. – chubbyk Oct 9 '10 at 17:25
  • +1 For bash aliases, I use them a lot. So much that it isn't even funny :P – Wuffers Oct 10 '10 at 16:29
1

Another solution would be to use Alfred.

It has a feature called clipboard snippets which allows you to paste any text anywhere. I use it for pasting 'Lorem ipsum' text when I need dummy text. So I press CMD+ALT+C, Alfred pops up, then type lorem, press ENTER and a bunch of dummy text is pasted in my code editor, or design software.

In Alfred v3 there is a new feature called snippets auto-expansion which does this automatically without the need of pressing commands. So in my case I type lorem anywhere on OSX, and that automatically translates to:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas porttitor diam cursus ligula tristique bibendum. Etc... you get the idea.

  • I use Alfred too. If you invoke and put a '>' before what you type, it sends the text to the Terminal. So if you store a snippet with '>' before it, then anytime you run the snippet it goes to Terminal. That's a big time saver, but you don't even have to use Terminal. Alfred Workflows also support running CLI scripts...Create a Workflow with a trigger 'killdock' then pass that to Run Script element with /bin/bash as Language, then enter something like 'killall Dock' in the script field. Type that shortcut, enter, it will run the bash process in the background—no Terminal window will pop up. – Pat Gilmour Apr 12 at 16:11
0

While not a terminal replacement, you might want to check out Code Collector Pro

It's designed for collecting and organizing all of your frequently used code snippets. It has a free trial, so you could take a look and see if it works for you.

0

Take a look as CLIX. It's a GUI frontend that keeps (and runs) libraries of shell commands (it comes with a bunch, and you can add your own). The UI is rather clunky, but it sounds like pretty much what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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