6

According to legend, in the early days what we now call "globbing" (i.e. using expressions like e.g. *.c, ./*.p?) was supported by one certain program /etc/glob, whose name in turn derived from "global command"...

I don't know about you, but for me, learning that "glob", "globbing", etc. comes from "global command" is about as illuminating as learning that it came from "globothymic pylotensity"...

What on earth is a "global command"?

6

Global is used here the same way it is in regular expressions (/g = global), i.e., it means "apply this command to everything applicable", not just the first possible instance.

Hopefully that "everything" vs. "something" applicability makes more sense of the "global" adjective. To explain a bit further, consider you have 3 files, a.txt, b.txt, and c.txt. If you issue a command with globbing, it will apply to all three because it applies to everything globally (a redundant phrase), not just the first thing that matches the pattern according to some (e.g. alphabetical) order.

  • Regular expressions seem to be a rich source of Unix conundrums, including the one that has probably scared away, or at least mystified, the most people: grep... – kjo Sep 6 '13 at 13:17
  • I think one of the issues with grep is that by default it uses POSIX style regexps, which have some subtle and not so subtle differences from the nowadays more common PCRE ("Perl compatible regular expression") style. No doubt this causes a lot of confusion for people when learning online! – goldilocks Sep 6 '13 at 13:25
  • well, that too, but I was just alluding to the sheer opacity of the name grep. Hmmmm, "sheer opacity": there's an oxymoron for you! – kjo Sep 6 '13 at 14:47
  • 2
    Might be stating the obvious, ...from the wikipedia page on grep ... the text editor ed had a command, g/re/p (globally search a regular expression and print). Manu of the idoms in sed, perl, and awk seem to echo from this tool, which makes sense given the lineage. – slm Sep 6 '13 at 18:38
  • @goldilocks I guess that's the best answer that could exist. It's still a dumb name. I will continue to think of it as related globules coming together, a la Terminator 2. – Scott Stafford Sep 13 '18 at 13:51

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.