Linked by Eugenia Loli-Queru on Mon 14th Aug 2006 16:42 UTC
General Unix 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.
Order by: Score:

Ouch.
by MechR on Mon 14th Aug 2006 16:56 UTC
MechR
Member since:
2006-01-11

"Give your fingers a break with Unix shell shotcuts"?

That sounds painful ;)

Reply Score: 5

spellcheck
by antik on Mon 14th Aug 2006 16:57 UTC
antik
Member since:
2006-05-19

Teh , spheller is borken.

Reply Score: 3

zsh
by butters on Mon 14th Aug 2006 18:03 UTC
butters
Member since:
2005-07-08

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?

Reply Score: 3

RE: zsh
by Sphinx on Mon 14th Aug 2006 18:50 UTC in reply to "zsh"
Sphinx Member since:
2005-07-09

Does anybody still prefer Korn?

Reply Score: 2

RE[2]: zsh
by Robert Escue on Mon 14th Aug 2006 18:56 UTC in reply to "RE: zsh"
Robert Escue Member since:
2005-07-08

Yes, I do. Most of the guys I work with use tcsh, but I'm considered "old school".

Reply Score: 2

RE[3]: zsh
by Sphinx on Mon 14th Aug 2006 19:02 UTC in reply to "RE[2]: zsh"
Sphinx Member since:
2005-07-09

You just can't go wrong with the classics.

Reply Score: 3

RE[4]: zsh
by jziegler on Mon 14th Aug 2006 22:11 UTC in reply to "RE[3]: zsh"
jziegler Member since:
2005-07-14

Work servers have ksh. So I tried using pdksh at home. Seems it does not speak UTF-8. Back to bash.

Reply Score: 1

RE[2]: zsh
by taos on Mon 14th Aug 2006 19:04 UTC in reply to "RE: zsh"
taos Member since:
2005-11-16

Same here.

Any big feature do I miss by using ksh instead of bash or zsh?

Reply Score: 1

RE[3]: zsh
by eMagius on Mon 14th Aug 2006 19:11 UTC in reply to "RE[2]: zsh"
eMagius Member since:
2005-07-06

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.

Reply Score: 2

RE[4]: zsh
by Robert Escue on Mon 14th Aug 2006 19:31 UTC in reply to "RE[3]: zsh"
Robert Escue Member since:
2005-07-08

And what bugs would those be?

Reply Score: 1

RE[3]: zsh
by renox on Mon 14th Aug 2006 23:07 UTC in reply to "RE[2]: zsh"
renox Member since:
2005-07-06

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.

Reply Score: 1

RE[4]: zsh
by taos on Mon 14th Aug 2006 23:12 UTC in reply to "RE[3]: zsh"
taos Member since:
2005-11-16

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

Reply Score: 1

RE[5]: zsh
by renox on Tue 15th Aug 2006 12:36 UTC in reply to "RE[4]: zsh"
renox Member since:
2005-07-06

>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..

Reply Score: 1

RE[4]: zsh
by Babi Asu on Tue 15th Aug 2006 01:09 UTC in reply to "RE[3]: zsh"
Babi Asu Member since:
2006-02-11

tcsh crappy vi mode annoys me too.

What are you talking about? A true unix user uses vi, not vim.

Reply Score: 3

RE[5]: zsh
by butters on Tue 15th Aug 2006 02:32 UTC in reply to "RE[4]: zsh"
butters Member since:
2005-07-08

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.

Reply Score: 3

RE[5]: zsh
by renox on Tue 15th Aug 2006 12:39 UTC in reply to "RE[4]: zsh"
renox Member since:
2005-07-06

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

Reply Score: 2

RE[5]: zsh
by rcsteiner on Tue 15th Aug 2006 18:28 UTC in reply to "RE[4]: zsh"
rcsteiner Member since:
2005-07-12

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.

Reply Score: 1

RE[2]: zsh
by butters on Tue 15th Aug 2006 02:14 UTC in reply to "RE: zsh"
butters Member since:
2005-07-08

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.

Reply Score: 2

RE[2]: zsh
by Tyr. on Tue 15th Aug 2006 14:23 UTC in reply to "RE: zsh"
Tyr. Member since:
2005-07-06

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

Reply Score: 3

RE[3]: zsh
by rcsteiner on Tue 15th Aug 2006 18:30 UTC in reply to "RE[2]: zsh"
rcsteiner Member since:
2005-07-12

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

Reply Score: 1

RE[2]: zsh
by adapt on Tue 15th Aug 2006 18:48 UTC in reply to "RE: zsh"
adapt Member since:
2005-07-06

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.

Reply Score: 1

RE: zsh
by twenex on Mon 14th Aug 2006 23:40 UTC in reply to "zsh"
twenex Member since:
2006-04-21

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.

Reply Score: 3

RE[2]: zsh
by CrimsonScythe on Tue 15th Aug 2006 08:56 UTC in reply to "RE: zsh"
CrimsonScythe Member since:
2005-07-10

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.

Reply Score: 1

Obscure
by Sphinx on Mon 14th Aug 2006 19:02 UTC
Sphinx
Member since:
2005-07-09

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?

Reply Score: 2

RE: Obscure
by kernelpanicked on Mon 14th Aug 2006 20:17 UTC in reply to "Obscure"
kernelpanicked Member since:
2006-02-01

$ echo ~
/Users/strike

Well what did you expect? You're reading a write up on shell usage from a freakin Mac user.

Reply Score: 1

RE[2]: Obscure
by Sphinx on Tue 15th Aug 2006 15:00 UTC in reply to "RE: Obscure"
Sphinx Member since:
2005-07-09

Gibberish, you must mean /usr/share? /usr/spool?

Reply Score: 1

RE: Obscure
by ahalsey on Mon 14th Aug 2006 20:54 UTC in reply to "Obscure"
ahalsey Member since:
2006-05-10
RE[2]: Obscure
by Sphinx on Tue 15th Aug 2006 14:54 UTC in reply to "RE: Obscure"
Sphinx Member since:
2005-07-09

Ah... that's different, never mind.

Reply Score: 1

v Shells shells shells...
by fithisux on Mon 14th Aug 2006 22:06 UTC
RE: Shells shells shells...
by kernelpanicked on Mon 14th Aug 2006 22:28 UTC in reply to "Shells shells shells..."
kernelpanicked Member since:
2006-02-01

"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.

Reply Score: 5

RE[2]: zsh
by Soulbender on Tue 15th Aug 2006 04:09 UTC
Soulbender
Member since:
2005-08-18

"Does anybody still prefer Korn?"
Yes.

Reply Score: 2

RE: Shells shells shells...
by Soulbender on Tue 15th Aug 2006 04:14 UTC
Soulbender
Member since:
2005-08-18

"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.

Reply Score: 3

RE[4]: zsh
by Soulbender on Tue 15th Aug 2006 04:17 UTC
Soulbender
Member since:
2005-08-18

"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?

Reply Score: 2

RE[5]: zsh
by kernelpanicked on Tue 15th Aug 2006 05:52 UTC in reply to "RE[4]: zsh"
kernelpanicked Member since:
2006-02-01

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.

Reply Score: 2

RE[5]: zsh
by renox on Tue 15th Aug 2006 12:44 UTC in reply to "RE[4]: zsh"
renox Member since:
2005-07-06

No I'm talking about the ksh installed on our Solaris 8 servers, I don't know exactly which version of ksh it is..

Reply Score: 1

RE[6]: zsh
by adapt on Tue 15th Aug 2006 18:55 UTC in reply to "RE[5]: zsh"
adapt Member since:
2005-07-06

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)

Reply Score: 1

RE[7]: zsh
by renox on Fri 18th Aug 2006 06:29 UTC in reply to "RE[6]: zsh"
renox Member since:
2005-07-06

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..

Reply Score: 1