Every skilled trade has its secrets — those little tricks, techniques, and tools that make light of even the most complex task. Programmers, system administrators, and other UNIX computer professionals have their own kind of specialized tools. Learn how to leverage the many shortcuts that the UNIX shell provides. With a little practice, you’ll work smarter, not harder.
“Give your fingers a break with Unix shell shotcuts“?
That sounds painful
Teh , spheller is borken.
Anyone here prefer zsh over bash? I know zsh has some expanded globbing features, but does it have any missing/modified features that might be annoying to long-time bash users?
Does anybody still prefer Korn?
Yes, I do. Most of the guys I work with use tcsh, but I’m considered “old school”.
You just can’t go wrong with the classics.
Work servers have ksh. So I tried using pdksh at home. Seems it does not speak UTF-8. Back to bash.
Same here.
Any big feature do I miss by using ksh instead of bash or zsh?
Any big feature do I miss by using ksh instead of bash…?
No, not really. That is, unless you consider bugs to be big features. Or a lack of speed, for that matter.
And what bugs would those be?
Personnaly ksh annoys me because to go back in the command history in vi mode, you can only use Esc+K whereas in bash you can use both the up arrow key and Esc+K.
tcsh crappy vi mode annoys me too.
Understand, but I am a vi person 🙂
For me it’s easier to hit Esc-k than up-arrow, because while Esc is almost always at the up-left corner, up-arrow is at different position/distance on different keybords (e.g. desktop v.s. laptop).
>I am a vi person 🙂
Me too, but I still prefer the up arrow against Esc+K: one key instead of two.
For me the shell should provide both: bash does, ksh doesn’t which is annoying, I don’t know about zsh..
tcsh crappy vi mode annoys me too.
What are you talking about? A true unix user uses vi, not vim.
I beg to differ. Vi is great, but vim is better. It has filetype plugins, syntax highlighting (in color!), and the “visual mode” that I find quicker than using marks. The are other little things that vim does better than vi, like backspacing through line breaks in insert mode. Mouse support comes in handy during code browsing or “sparse editing” (if you get what I mean). I have both ctags and cscope integrated into vim, as well as LaTeX.
I have no problem using vi as long as I’m being paid for my time. You’d need to pay me significantly more to use Emacs, though. I’d rather use Gedit…
Shells and editors are very personal things. If you use them all day, the little things can drive you nuts.
I’m not talking about vi vs vim, I’m talking about the feature of the interpreters, searching what you want in the history with Esc+/, etc which can use either vi-like shortcuts or emacs-like shortcuts.
tcsh provide a good emacs-like mode but a crappy vi-like mode (at least the tcsh (old) version that we have on our Solaris servers).
Many of the old-school “true UNIX users” that I’ve met over the years have a severe case of tunnel vision and don’t yet realize that there’s more to life than the smallish set of vanilla tools which come bundled with the OS.
Some of those tools are admittedly excellent, but some of them have been improved or even superseded by open source variants, and some of them were fine 20 years ago and still work but are showing their age today.
Some examples: I use Midnight Commander for doing file management on Solaris, I use either NEdit or mcedit (*not* vi) to edit source, I use tools like exuberant ctags and Eskil to navigate through and compare code, and I use DDD to debug stuff instead of command-line gdb (with or w/o the TUI).
Why? For me, those things are far more productive than the normal cd/cp/mc/rm/whatever commands, vi, traditional grep searches, and the raw debugger.
I don’t question folks who use traditional utilities for their work, and I can still use them in a pinch if I have to, but I question those who suggest that I regress back to that level when I’ve already moved on to a set of tools which I’m more comfortable with.
At work I have to use ksh for scripting. It’s 99% the same as bash, but arrays are a huge quagmire in ksh, and don’t get me started on the ‘set’ command. I don’t dislike scripting in ksh, but in the few ways that bash and ksh differ, I prefer bash.
I cannot _stand_ ksh as an interactive shell. I’m a huge vi fan, but it just does not make sense for command editing. I developed muscle memory on bash, with tab completion and up/down-arrows for history, and anything else feels incredibly awkward. At least seven times per day I want to kick down the door to the machine room and put a large calibre round through the freakin build machine that doesn’t have bash installed.
Ahhh… I feel much better now… it’s been a long day.
Does anybody still prefer Korn?
Yep. Learning ksh is still the best bet if you work with one or more of the big boys like Solaris or AIX. Just try to convince a big company to roll out zsh on all their machines – I dare you 🙂
I work for a largeish company, and their Sun boxes all have bash and Perl and them (as far as I can tell), which I found to be a pleasant surprise. They default to ksh, but it doesn’t take long to type “bash”. 🙂
Im a huge fan of korn. Im sure that bash provides most (if not all) of the same functionality but i always seem to be faster with korn and vi mode.
.adam.
I love zsh. Favourite feature: command, path, damn-near-everything completion. Slower and bigger than [batc]sh maybe, but on a 500+MHz plus box, it still flies.
I love zsh as well. It has an enormous amount of neat features and is very powerful. For a great starting point to see what you can do with zsh, check out this guy’s dotfiles:
http://strcat.neessen.net/dotfiles/#zsh
Take your time and go through all the files; they’re fairly well commented.
I’ve only been using *nix for around 20 years and had never heard anyone use the term, “siqil”, since I was a printers apprentice in the early 70’s as a reference to the shot mark or union label, using this term for the home directory tilde was a surprise. Anybody ever hear that before?
$ echo ~
/Users/strike
Well what did you expect? You’re reading a write up on shell usage from a freakin Mac user.
Gibberish, you must mean /usr/share? /usr/spool?
sigil, not siqil.
See http://www.perlmonks.org/?node=sigil&go_button=Search
and http://en.wikipedia.org/wiki/Sigil_(computer_programming)
Ah… that’s different, never mind.
what if BSD used BASH by default?
Lack of speed in shell scripts tolerable, lack of features or lack of understanding? Fatal!!!
TCSH -> obscure
ZSH -> lack of features
KSH -> unmaintained
FISH? Mmmmm…. something different 🙂
I prefer BASH. Well written, easy to learn, well supported, many features.
Why do we still speak about the others? If you can’t do it on BASH use a scripting language.
“TCSH -> obscure”
Maybe. I’ll give you that one.
“ZSH -> lack of features”
You’ve got to be completely insane. Me thinks you’ve never read the docs on this one.
“KSH -> unmaintained”
Since when? Not only is pdksh maintained, but the pdksh used on both OpenBSD and NetBSD are fully maintained and get new features quite often.
“Why do we still speak about the others? If you can’t do it on BASH use a scripting language.”
Because I’m damn well not installing a non-standard shell on my BSD or Solaris boxes just to write scripts. This may ne a shocker for you, but Linux is not the only system around and bash is hardly a standard on any other UNIX/UNIX-like system.
“Does anybody still prefer Korn?”
Yes.
“lack of understanding”
yes, because they’re all so very different…no wait, they aren’t.
“TCSH -> obscure”
So?
“ZSH -> lack of features”
Wrong.
“KSH -> unmaintained”
Wrong.
How many new features does a shell need anyway?
“Why do we still speak about the others?”
Because people like them?
“If you can’t do it on BASH use a scripting language.”
If your scripts aren’t compatible with POSIX /bin/sh you’re doing something wrong.
“Personnaly ksh annoys me because to go back in the command history in vi mode, you can only use Esc+K”
What are you talking about? I’ve always been able to use the arrow keys for history in (pd)ksh. Maybe you’re thinking of csh?
Agreed. I’ve never had a problem with the arrow keys not working in vi mode. In emacs mode it requires a slight bit of hackery but still no big deal.
No I’m talking about the ksh installed on our Solaris 8 servers, I don’t know exactly which version of ksh it is..
Try `set -o emacs`
Obviously you loose the functionality of the ownage that is vi mode, but you can use the arrows after that (at least on NetBSD)
No, I’m a vi guy not emacs (I never manage to remember the equivalent of Esc+/ search in history with emacs mode), I use Esc+K instead of the up arrow, but it is a bit stupid IMHO: two keys instead of one for a very common action..