Advice for a Pain Free Command Line Experience on a Mac?
I find myself using terminal a fair bit on the mac. From "sudo apachectl restart" to restart apache to running MySQL commands (I have GUI too, but some stuff is easier in terminal), cmhod'ing files and directories and a bunch of other little bits and pieces.
My question is where is the smart replacement for terminal? I'm looking for text shortcut tools, code complete/context sensitive help, all the stuff that you'd expect in a Java IDE so I can type less, remember less and do more on the command line as an occasional user.
Any thoughts on a starting point?


Here are few that I commonly use - sorry if you already knew some of them. Also, as I'm not an expert myself, this is *not* a complete list... just the ones I've found over the time
- `cd ~` - ~ is an alias for current user's home dir. You can use it wherever you might be at the moment. If you have multiple users you can `cd ~username`.
- in you home dir type `cd Do` and then press TAB key... it should turn into `cd Documents`, if Documents is the only dir/file starting with Do. If there are multiple matches press the TAB key twice (quickly, just like "double-click" - or "double-tab" in this case :) ) to get a list of matches.
- tab completion also works for commands, unfortunatelly it won't work for commands typed after sudo, but, for example, you can type `sud[TAB]` :) (of course it's useless for this example.
- Aliases: type in terminal `alias qq='sudo apachectl restart'` and then type qq on command line (you can use tab completion for aliases too). You can have as many aliases as you wish. That alias exists only until you close that terminal window. To have aliases available when you open a terminal window you must write them in ~/.profile - one per line, of course. Remember, that file is only read when starting a new shell (opening a new terminal window).
- CTRL+A will get you to the beginning of a line, CTRL+E to the end. There are other CTRL+smth commands, but I only use these two
- goto Terminal->Window settings, select Keyboard from the dropdown and check "use option key as a meta key" (and optionally "Use settings as default". After that you can delete a word by pressing backspace while keeping down alt. Most likely there are other ALT+smth too, but I only use this one...
That's pretty much it, and it's been enough for me for all the years I've been using command line... well, again, I'm not an expert, I never tried to improve it more than this... I'll post again if I remember anything else.
Just saw this post on O'Reilly in my feeds this morning:
http://www.oreillynet.com/mac/blog/2007/03/bashful...
alias startmysql="mysql -u mysqluser -p"
You can shorten the alias name even further if speedy typing is what you're concerned about.
I use iTerm as well - mostly because of the tabbed sessions - but I don't know of any non-shell-based shortcuts to reduce typing.