Where GREP Came From - Computerphile

Where GREP Came From - Computerphile

Computerphile

5 лет назад

933,433 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Michael Stora
Michael Stora - 22.09.2023 20:41

I love grep and I love the Federalist Papers. I never knew of the connection!

Ответить
Vicky
Vicky - 13.09.2023 16:42

but does grep work with files those are crossing GB limit and faster.

Ответить
Michael Neidhart
Michael Neidhart - 15.08.2023 19:03

Please remember kids: ed is the standard editor.

Ответить
Randy Stevensmom
Randy Stevensmom - 03.07.2023 00:50

Sure I'm obviously curious to know how grep came about but how regular expressions were developed would be the broader question for me....and yeah ok I've hit halfway and it's there ok my bad

Ответить
CodeStalk
CodeStalk - 21.06.2023 20:13

grave disadvantage...

Ответить
Malinga Tembo
Malinga Tembo - 15.06.2023 17:15

"..and also they had one great disadvantage, no of them were Ken ..."

Ответить
Seb Splatter
Seb Splatter - 01.06.2023 11:05

This just blew my mind. I just started out trying to wrap my head around vim as an editor and this video has already helped contextualize so many of its commands and shortcuts. Apparently if you come out of the UNIX-World (I dont!) many many of these supposedly hard to memorize command-structures already existed in the form of ed and grep and you are literally using unix tools... goddamnit I need to learn more about unix now, this is just brilliant!

Ответить
Dishan Shakya
Dishan Shakya - 18.03.2023 17:43

Vim keybindings continued the legacy of ed editor
never knew that

Ответить
Tolga Mutlu
Tolga Mutlu - 17.03.2023 02:36

You need a license to be riding ken thompsons meat like dat 🏇

Ответить
Stratelite
Stratelite - 28.02.2023 06:15

So quick summary:
coded in PDP assembly language
ran on 32KB of ram and maybe 5MB of disk
1 day dev time
Ken muthafuckin Thompson ladies and gentleman.

Ответить
Tristan Boyle
Tristan Boyle - 12.02.2023 13:36

nice

Ответить
random-characters
random-characters - 30.01.2023 15:25

Lol, I thought that grep is misspelled grab 😂

Ответить
颜巾斌
颜巾斌 - 30.12.2022 19:16

amazing story , tks

Ответить
lannes romain
lannes romain - 26.11.2022 19:59

it looks like a lot like sed does ed the grand father of sed?

Ответить
theacp127
theacp127 - 25.11.2022 08:19

He was amazingly sharp and well spoken for being about 76 at the time of recording. His knowledge and experience just radiates from him.

Ответить
HankC9174
HankC9174 - 20.11.2022 17:50

thinking of ed sends shivers down my spine

Ответить
Creachter
Creachter - 25.09.2022 05:13

I am truly in the presence of greatness here.

Ответить
Charles Lord
Charles Lord - 13.09.2022 21:47

Boy this takes me back! I started school in 1973 and remember ed well!

Ответить
J W
J W - 06.09.2022 19:51

It wasn't written in no time at all! Here's an expanded part of the story:
----------------------

Even though things were very simple, the text editor ed had a full implementation of regular expression pattern matching. Ken Thompson based it off his work at Berkeley years before on a text editor called QED.

In this early UNIX environment, to search for a pattern in a file, you opened the file in ed and then did a "g/search-string/p" command, where "search-string" was a regular expression.

One day Ken got tired of having to get into ed for every stinking file he needed to search and decided to do something about it. He copied ed.s (remember, all assembler) to s.s and started cutting. If a line of s.s didn't do regular expressions, it was out. The result was that his command "s" did searches with regular expression on one or more files.

Not wanting to be "that guy" who pushes all his bad ideas out to the world (I'm not sure I know of anyone who thought he ever had a bad idea) he kept the new command in his private bin directory /usr/ken/bin.

One day Dough McIlroy, who many think was the smartest of the early UNIX folks and least recognized, asked if Ken "...could write something that did regular expression searches without having to get into the editor."

"Let me think about it," Ken answered.

That night, Ken issued the command "mv /usr/ken/bin/s /usr/bin/grep."

The next morning, Ken showed the new command to Doug and asked, "Is this the kind of thing you were thinking of?"

"Perfect!" Doug replied, impressed with how fast Ken could cook something like this up.

Why "grep?" Ken couldn't use the command "s" for a public utility. It's too short. We use one letter commands all over the place but only locally. I have "m" and "r" script files everywhere, the former runs "make" and the latter is a test script.

So g/RE/p leads one naturally to grep. It was just on the spur of the moment decision. That's the story of how we got grep and how it got its name.

Oh, and Ken told Doug about why the development cycle was so fast.

Ответить
agou1980
agou1980 - 02.09.2022 10:10

The legend himself, plus a beautiful iMac in the background. What more can you ask for?

Ответить
Wander
Wander - 29.08.2022 06:09

ed is still included in unix derivatives, Linuxes and macOS. It's useful for learning vim commands.

Ответить
leo
leo - 25.08.2022 10:58

Ken Thompson says in an interview (that is probably now in your video suggestions) that when that guy asked for something like grep, he had already done it for himself.
So sadly no, he did not do it in one night, still impressive work of course :).

Ответить
ajk786
ajk786 - 25.08.2022 06:32

Computerphile contributes to computer science 🧪

Ответить
Anna Nass
Anna Nass - 19.08.2022 17:00

It’s hard for me to stay interested in learning computer science when it’s nothing but code, code, code. But why? Where does this all come from? How did it begin? Why is it important? What did people do before this advancement? This channel answers those questions for me and keeps me interested in learning. Bless you, computerphile ❤️

Ответить
Klaus Fluegelschwanz
Klaus Fluegelschwanz - 16.08.2022 21:03

This ending is not for the proud

Ответить
Shapkofil
Shapkofil - 01.07.2022 17:00

i came here to learn grep went out with sublime knowledge about sed

Ответить
Patrick Harmon
Patrick Harmon - 10.06.2022 03:24

i had to use a grep to figure out the temperature of my cpu i used this sudo powermetrics --samplers smc |grep -i "CPU die temperature" and i can monitor when my cpu is overheating

Ответить
theMuritz
theMuritz - 05.06.2022 19:26

None of them were Ken Thompson … it made me smile around my skull

Ответить
Scott B1969
Scott B1969 - 04.06.2022 14:09

I love the way he teaches. The ED commands remind me of the syntax in AWK. Bet there is some link, get Ken knows.

Ответить
GaryL3803
GaryL3803 - 21.05.2022 19:29

OMG, I remember being a AT&T technician that visited Bell Labs in Holmdel, NJ (I think) in about 1974 or so. We were a new hardware maintenance group for DEC PDP-11s and were given a demo of Unix including a demo of GREP. We were blown away with how GREP piped to other utilities like WC could do really useful analytics. Was still using it when I retired as an Oracle DBA in 2020 when the pandemic hit. Still occasionally play with it on Ubuntu.

The original Unix filesystem was such a wonderfully elegant piece of software that was the foundation so much else.

Ответить
Cillian Scott
Cillian Scott - 16.05.2022 18:01

Wow, fascinating!

Ответить
JoseCan
JoseCan - 26.04.2022 19:12

Following the theme of computing knowledge lost to time: people seem to have forgotten what "pica" and "elite" mean in terms of printing.

- pica: 10 characters per inch
- elite: 12 characters per inch

It came from the name of two common fonts found on IBM typewriters: Pica and Elite.

As a kid i had a ruler laid out with pica and elite markings, so you could measure and layout text.

Such things are gone. No printer day will have "pica", "elite", "condensed pica", "condensed elite" buttons.

Ответить
a
a - 25.04.2022 18:53

I am still going to call it ed lol

Ответить
Catsozen Neko
Catsozen Neko - 25.04.2022 16:09

Me before this video : confident person
After video : I'm not Ken Thompson....what have I been doing with my life....I'm no better than a sack of peanuts....

Ответить
PJ
PJ - 24.04.2022 01:47

Explanations like this are valuable for understanding the context of the things students are learning in modern cs.

Ответить
Mark Ganus
Mark Ganus - 23.04.2022 05:22

what is it with grep not being compatible with binary files?

Ответить
KsuhDilla
KsuhDilla - 21.04.2022 12:41

I use visual grep

Ответить
Jangkrik-chan
Jangkrik-chan - 20.04.2022 08:08

Fun fact: you can suffocate your linux machine by doing this
cat /dev/urandom | grep 0

Ответить
T J
T J - 15.04.2022 13:01

kudos to Stephen Kleene inventor of regular expressions.

Ответить
Pedritox0953
Pedritox0953 - 05.04.2022 17:20

Wonderful lecture!

Ответить
Hemiac Plurge
Hemiac Plurge - 28.03.2022 01:59

Fellow vi users: did you get a little chill when he started explaining ed commands?

Ответить
Naveen Kumar Kotta
Naveen Kumar Kotta - 25.02.2022 03:19

Grep is everyday used command in Linux. Excellent

Ответить
MidnightSt
MidnightSt - 06.02.2022 21:19

One of the weird issues with any unix program is "where does that name come from?".
And the answer always is, at least partially "let me take you back about 40 years or more..."

Ответить
Peter Lewerin
Peter Lewerin - 04.01.2022 13:43

I wish I could convey my teenage son's face when I told someone else about how Bell Labs bought a printer that turned out to not be able to do what they wanted, so they got a guy to hack it. My son had been caught in horrible programming/webbuilding/tinkering addiction through me, but I had no idea how deep he had burrowed on his own. Anyway, I saw on his face that he found it hard to believe that they could decode the innards of a 1970s laser printer... and then I told them that the guy was named Ken Thompson, and my son's face immediately lit up with glee and absolute faith. :)

Ответить
K Chinthaka
K Chinthaka - 04.01.2022 06:13

fascinating. I often use grep (actually I have a shell script so I only need to type 'g "text I am searching for"') and had wondered why it's called that.

Ответить
Bill Allen
Bill Allen - 31.12.2021 03:10

It's a great program. Thanks I've wondered for years!

Ответить
Roop Charlie
Roop Charlie - 25.12.2021 14:41

most interesting video I watched over xmas, and the most powerful program ever written. I don't know how I've survive without it.

Ответить