←back to thread

311 points todsacerdoti | 1 comments | | HN request time: 0.21s | source
Show context
plorkyeran ◴[] No.46237424[source]
> grep (global regular expression print), awk (Aho, Weinberger, Kernighan; the creators’ initials), sed (stream editor), cat (concatenate), diff (difference). Even when abbreviated, these names were either functional descriptions or systematic derivations.

If you asked someone unfamiliar with unix tools what they thought each of these commands did, diff is the only one which they would have even the slightest chance of guessing. It's ridiculous to complain about "libsodium" and then hold up "awk" as a good name.

replies(13): >>46237555 #>>46237769 #>>46238238 #>>46238337 #>>46238800 #>>46238821 #>>46238937 #>>46239204 #>>46239290 #>>46240333 #>>46240524 #>>46242479 #>>46243231 #
bee_rider ◴[] No.46238337[source]
I’m not sure I like awk, sed, or cat, I think these are just names we’re used to, not good really. diff seems ok.

grep almost has an onomatopoeic nature to it… like, it sounds like you are grabbing or ripping the patterns out of the file, right?

replies(2): >>46240190 #>>46241191 #
fsckboy ◴[] No.46241191[source]
>I’m not sure I like awk, sed, or cat

sed is not "stream editor" as it says above, it's "stream ed", where ed was another prexisting program which was essential and everybody knew it. its name was from "editor" shortened.

the sed commands are the ed commands. so, it's almost not possible to say "i don't like the name", it rests on a rich tradition, it's the stream version of ed. (ed commands are very similar to vi commands at heart.) it's sad the unix crowd never grokked teco because teco was already a programmable stream editor from a tradition that was not particulary streamy. it predated ed by a decade and would have fit the unix world perfectly. maybe it was already too big? I'm sure they would have known about it. Emacs does come from the teco tradition.

grep got its name from what the "grep" command would look like typed within the ed editor.

awk should not be thought of as a tool, it's a programming language, and has every right to the name as ada or pascal or haskell does.

back in those days, filenames had to be short, long names were not allowed, no space, and also, people liked typing short commands. concatenate shortened is... well, cat is as good a name as any. back then the word console was popular for the name of the terminal connected directly to the computer (frequently already logged in), perhaps con was already in use then, it definitely had a meaning already on DEC operating system machines as inherited on Microsoft machines, CON: is still console, and Bell Labs was using DEC machines.

btw at some sites there is a "dog" command. it's like the "cat" command, but it starts at the end of the file and then shows any additions. so, if you want to see if anything is being added to a logfile, you can "dog" the file (which is completely broken when VMS Windows dorks show up and decide to make everything binary) now the verb "to dog" in English means "to follow closely", so it's a cute wordplay on cat and means what it does, similar to "less is more". in less, you can accomplish something like "dog" (dog with more context) with the "F" command. these individual pieces of wordplay don't form a coherent network in the end, but as new things are invented over time they are fun and help you remember new commands till you get used to them.

replies(1): >>46241459 #
1. rswail ◴[] No.46241459[source]
> ed commands are very similar to vi commands at heart

vi was build on top of ed.

Ed was the Unix line editor, which is why all the commands after a colon have the form of "start,endcommand", eg "1,$p" would list all the lines of a file on your tty/decwriter.

1,$s/findexp/replace/g would s ubstitute all examples ("g") of findexp on the lines 1 through EOF