Where GREP Came From - Computerphile

  Рет қаралды 928,949

Computerphile

Computerphile

5 жыл бұрын

Commonly used grep was written overnight, but why and how did it get its name? Professor Brian Kernighan explains.
EXTRA BITS: • EXTRA BITS GREP from E...
Inside an ALT Coin Mining Operation: COMING SOON
Unix Pipeline: • Unix Pipeline (Brian K...
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Пікірлер: 1 000
@toreanstudios607
@toreanstudios607 5 жыл бұрын
Students: this project is impossible Professor Kernighan: KEN THOMPSON built this GREP in A CAVE with a BOX OF SCRAPS
@Fromatic
@Fromatic 5 жыл бұрын
Students: but.. we're not.. Ken Thompson..
@guestimator121
@guestimator121 4 жыл бұрын
@@Fromatic Well, no one's perfect, except for Ken Thompson
@daffy1981
@daffy1981 4 жыл бұрын
@@Fromatic Exactly.. Bruce Lee used to do pushups with on single finger..
@vibhorsteele
@vibhorsteele 4 жыл бұрын
Iron man reference isn't it?
@professorfontanez
@professorfontanez 4 жыл бұрын
@@Fromatic Professor Kernighan: And that's why you have a week to complete the assignment and not just a few hours.
@Goodvvine
@Goodvvine 5 жыл бұрын
At an interview - recruiter: what would you consider your greatest weakness? me: I'm not Ken Thompson
@u.v.s.5583
@u.v.s.5583 5 жыл бұрын
I'm not Clay Thompson. Oops, wrong interview
@ruochenlin7994
@ruochenlin7994 5 жыл бұрын
Hired.
@Thallod
@Thallod 5 жыл бұрын
@@u.v.s.5583 I'm not Clay Thompson, but 20 dollars is 20 dollars.
@charlesbaldo
@charlesbaldo 5 жыл бұрын
My greatest weakness is i do not think i have any weakness.
@brittanymarie8523
@brittanymarie8523 4 жыл бұрын
Absolutely the best 🤣
@davidgillies620
@davidgillies620 5 жыл бұрын
Not being Ken Thompson is a struggle every working software engineer has to contend with.
@iAmTheSquidThing
@iAmTheSquidThing 5 жыл бұрын
Except Ken Thompson.
@cbernier3
@cbernier3 5 жыл бұрын
nope, he's retired.
@iAmTheSquidThing
@iAmTheSquidThing 5 жыл бұрын
cbernier3 - Last I heard he was still doing some work for Google.
@cbernier3
@cbernier3 5 жыл бұрын
They say he retired from Google.
@sumitshresth
@sumitshresth 5 жыл бұрын
hmm jeff dean disagrees
@bjornmu
@bjornmu 5 жыл бұрын
grep is not only a program, it has become a verb. It is common among computer people to talk about grepping for something. Which may or may not actually be done with grep.
@okuno54
@okuno54 5 жыл бұрын
My personal favorites are vgrep and vdiff, just to specify you're doing it by eye.
@ThePharphis
@ThePharphis 5 жыл бұрын
diff?
@jasonbiegel5
@jasonbiegel5 5 жыл бұрын
"make your code greppable"
@amyshaw893
@amyshaw893 5 жыл бұрын
i recently asked some friends if there was a way to "grep through messenger history"
@OpenGL4ever
@OpenGL4ever 5 жыл бұрын
What i like most at ebooks is the fact, that they are greppable.
@crcrewso
@crcrewso 5 жыл бұрын
“And of course they all had one disadvantage, None of them were Ken Thompson” Oh My!!!! Best line of the series.
@ylstorage7085
@ylstorage7085 3 жыл бұрын
both bill gates and mark zuk got that assignment. (fake history)
@Coillcara
@Coillcara 2 жыл бұрын
@@ylstorage7085 Bill Gates is a genius, just not in programming.
@corey333p
@corey333p Жыл бұрын
"grave" disadvantage!
@dgollas
@dgollas 5 жыл бұрын
It's great to watch and hear legendary computer scientists talk about such fundamental and ubiquitous tools.
@SmithdoesMinecraft
@SmithdoesMinecraft 5 жыл бұрын
Hello my cousin.
@denravonska
@denravonska 2 жыл бұрын
In Swedish the word "grep" means "pitchfork" which I've always though fit beautifully. You have a stream of stuff coming in and you jam your pitchfork in to grab what you're interested in.
@VastyVastyVoid
@VastyVastyVoid 2 жыл бұрын
I always mentally converted it into the dialectal "greppa [tag i]" -- roughly synonymous with "seize hold of."
@dominikkuzila
@dominikkuzila 2 жыл бұрын
In Slovak it just means grapefruit lol
@BobWitlox
@BobWitlox 2 жыл бұрын
In bad Dutch English, grab is pronounced as grep. So mentally I've always thought of grabbing text from input.
@jek__
@jek__ 2 жыл бұрын
Like grepping a needle in a haystack!
@TheArrowedKnee
@TheArrowedKnee 2 жыл бұрын
In Norwegian we also have "Å gripe", meaning "To grab", which sounds very close to grep
@piotrarturklos
@piotrarturklos 5 жыл бұрын
This video is such a gem! Computerphile is making a great contribution to the history of computer science.
@iamSkyBoy24
@iamSkyBoy24 2 жыл бұрын
1
@kamilziemian995
@kamilziemian995 Жыл бұрын
Indeed.
@bool2max
@bool2max 5 жыл бұрын
I've been watching videos from this channel for a pretty long time and I just now realized that this guy is THE Brian Kernighan.
@whuzzzup
@whuzzzup 5 жыл бұрын
/applause But your avatar is very fitting.
@williambarela2791
@williambarela2791 5 жыл бұрын
Yep. For those who are still confused about who THE Brian Kernighan is, checkout K&R's C Programming Language: a.co/6C40vKc.
@Orww
@Orww 5 жыл бұрын
a wild kripp has been spotted!
@mmaepo
@mmaepo 5 жыл бұрын
Same. Mind blown.
@Outfrost
@Outfrost 5 жыл бұрын
Oh yeah, same. Someone mentioned Prof. Kernighan in the comments, I did a double take, then slowly realised who's talking in the video.
@skaruts
@skaruts 5 жыл бұрын
You don't see this quality content on TV.
@darylallen2485
@darylallen2485 5 жыл бұрын
There's no naked women, beer, or men acquiring brain damage. In America, that means audience fell asleep.
@baruchben-david4196
@baruchben-david4196 4 жыл бұрын
I don't even own a TV.
@jtgdyt2
@jtgdyt2 4 жыл бұрын
...unless you cast KZbin to your TV.
@SmartWarthog
@SmartWarthog 4 жыл бұрын
Reminder that Computer Chronicles was a TV show in the 80's.
@TVIDS123
@TVIDS123 4 жыл бұрын
SmartWarthog so... 30 years ago? Not now then lol
@rhymereason3449
@rhymereason3449 5 жыл бұрын
Thank you Mr. Kernighan and all your contemplates like Bill Joy, Dennis Richie, Ken Thompson, and others for giving us the greatest computing environment imaginable. Amazing how after 50 years it's still so relevant because of your genius.
@Collaborologist
@Collaborologist 4 жыл бұрын
For context: #programmers to develop IBM OS360 = ? #programmers to develop Windows / OS/2 = ? #programmers to develop Lisa = ? and then... #programmers to develop Linux = :) ?
@xkguy
@xkguy 4 жыл бұрын
I learned Fortran in the mid 60s. It required punch cards and a single error would reject your whole batch. I knew then computers would never be very important.
@martinrocket1436
@martinrocket1436 4 жыл бұрын
xkguy, … and you were right.
@eminusipi
@eminusipi 4 жыл бұрын
Yes(from FORTRAN IV in the '70s), and the complier would didn't say error but rather errata F(fatal), I(informative for non usasi) or N(for non fatal error). Submit your cards and hope for the best. I almost forgot that sometimes when formatting the printout hollerith code: "at least one redundant delimiter has ocurred".
@thomaskember4628
@thomaskember4628 4 жыл бұрын
I also learned Fortran in the 60s. I ran my first program on an IBM 360. After it worked alright, I took a dump of the memory and examined it trying to figure out how the source code was translated into the machine code. The first Fortran command was read a card. It was very difficult to find the equivalent machine code instruction in the dump. There was so much overhead.
@kalijasin
@kalijasin 3 жыл бұрын
You learned FORTRAN from John Backus? 😮
@TAP7a
@TAP7a 2 жыл бұрын
Every day I don’t use FORTRAN is one I treasure and reflect on my gladness for having the privilege to have done so And this is coming from a guy who mainly writes R
@onemanenclave
@onemanenclave 4 жыл бұрын
When he said "25 years ago" my first thought was "1975". Then he said "1993", and I realised that we're already close to 20 years into the 21st century. Wow.
@kebien6020
@kebien6020 3 жыл бұрын
@@new-lviv This aged quite well. 2020 has been quite roaring
@cipher3966
@cipher3966 3 жыл бұрын
You guys are so 2010s
@harshsharma03
@harshsharma03 2 жыл бұрын
@@kebien6020 2022 has been even more roaring so far.
@dawnwatching6382
@dawnwatching6382 Жыл бұрын
Very soon 1975 will be 50 years ago! That's crazy.
@vegidio
@vegidio 4 жыл бұрын
This guy is one of the living legends of computer science! I still have his book at home
@yashjakhotiya5808
@yashjakhotiya5808 3 жыл бұрын
I keep it as a priced possession
@imranariffin2688
@imranariffin2688 4 жыл бұрын
"I was teaching at Princeton as a visitor, and I needed an assignment for my programming class. And I thought "Hmm!". So what I did was to tell them - the students in the class: "OK, here is the source code for 'ed'. It was at the time probably 1800 lines of C. "Your job is to take these 1800 lines of C and convert them into 'grep' as a C program. OK, and you've got a week to do it". And I told them at that point, that they had a couple of advantages. First, they what the target was. Somebody had already done 'grep' so they knew what it was supposed to look like. And all they had to do was replicate that behaviour. And the other thing is that it was now written in C. The original 'grep' was written in PDP 11 assembly language. And of course, they also had one grave disadvantage: None of them were Ken Thompson." 8:58 - 9:45 Hahaha savage
@chzcake44s
@chzcake44s 3 жыл бұрын
@Joshua Murphy converting to grep?
@user-he1rn5uu5w
@user-he1rn5uu5w 3 жыл бұрын
@Joshua Murphy g/re/p was already a command in ed, which prints(p) every occurrence(g) of the described sequence(re) in the document. So basically what the students need to do was to load everything on the file system into ed? Or make ed run outside of its boundary of one single document? A very great project tbh. So clever, so tricky, disastrously hard without the knowledge of the history of grep. But without a doubt a very great project.
@ruadrift
@ruadrift 3 жыл бұрын
@Joshua Murphy Ken just read the file in chunks, did a match on a chunk, stored the results, and then did the next chunk of the file. I guessing this was a one-hour assignment for someone who knew C.
@FireWyvern870
@FireWyvern870 2 жыл бұрын
@@ruadrift not with memory limitations at the time
@edwardmacnab354
@edwardmacnab354 Ай бұрын
@@user-he1rn5uu5w so the trick was figuring out that grep was just g/re/p ?
@benjamingeiger
@benjamingeiger 5 жыл бұрын
A lot of the aspects of ed that are covered here still work in vi (or even vim).
@farischugthai5598
@farischugthai5598 5 жыл бұрын
Benjamin Geiger Vi's source code traces back to Ed. After Ken Thompson wrote Ed, Em was created (Ed for Mortals), then Bill Joy wrote Ex. Yup just like Vi's ex mode. Ex became Vi, Vi became Vim and the rest is history
@johnfrancisdoe1563
@johnfrancisdoe1563 5 жыл бұрын
Faris Chugthai Don't forget cousins like CP/M's ED, or IBM's XEDIT.
@3nertia
@3nertia 5 жыл бұрын
They can also work directly on the command line in BASH x]
@tomihawk01
@tomihawk01 5 жыл бұрын
Then Emacs came along, heralding the great editor wars that spanned three decades and saw many software engineers go off to fight in the trenches of Usenet and never return.
@OpenGL4ever
@OpenGL4ever 5 жыл бұрын
@@tomihawk01 And in the end, nano won. (me starting a new war. SCNR)
@aner_bda
@aner_bda 5 жыл бұрын
From my beginning of learning Linux and Unix, I've known that grep stood for global regex print, but never heard the full story, and it's relation to ed. Really great video!
@jcf20010
@jcf20010 2 жыл бұрын
Those ed commands can also be found in vi and sed.
@alvaro_ch
@alvaro_ch Жыл бұрын
AFAI grep stands for Global Regular Expression Parser. but who knows? 🤷‍♂
@edwardmacnab354
@edwardmacnab354 Ай бұрын
@@jcf20010 i love standardization
@NunoLopes99
@NunoLopes99 5 жыл бұрын
I'm a simple man, I see a video of Brian Kernighan and I click it.
@mikeklaene4359
@mikeklaene4359 5 жыл бұрын
grep - simple magic. In 2007 at the age of 60 I was applying for a job in IT at SEPTA - the transit agency for the Philadelphia area. At the time they were using networked SCO Unix systems for the commuter rail dispatching system. The first question asked during my employment interview was: What is 'grep' and how can you use it? Having had been introduced to UNIX in the mid-1980s - it was a rather easy question.
@JorgetePanete
@JorgetePanete 5 жыл бұрын
having had been introduced?
@markgreen66
@markgreen66 4 жыл бұрын
Did you get the job?
@santiagoserna4
@santiagoserna4 2 жыл бұрын
So you nailed the interview and now you're the owner right?
@mikeklaene4359
@mikeklaene4359 2 жыл бұрын
@@markgreen66 Yes I did. I was most surprised because of my age. I stayed there until turning 68.
@mikeklaene4359
@mikeklaene4359 2 жыл бұрын
@@santiagoserna4 Owning was not quite possible as SEPTA is a rather large multimode transit agency. But I did "own" my position for a solid 8 years.
@BrunoRegno
@BrunoRegno 5 жыл бұрын
The awe with which you, Mr. Brian Kernighan, speak of Mr. Ken Thompson... It just drives home the fact that we all just stand on the shoulders of giants. You might have received astronomical amounts of these, but here is one more: THANK YOU.
@shavenith4369
@shavenith4369 5 жыл бұрын
...and the original grep was written in PDP-11 assembly language...!> Overnight.....
@johnyang799
@johnyang799 4 жыл бұрын
@jqbtube The fact that it's in assembly language makes it as impossible.
@jtgdyt2
@jtgdyt2 4 жыл бұрын
@@johnyang799 Not if you know assembly language.
@kenmolinaro
@kenmolinaro 4 жыл бұрын
@@jtgdyt2 Agreed. I found it to be a huge advantage in latter years, that the first language I learned and used for 2 years, was assembly.
@tomahzo
@tomahzo 3 жыл бұрын
I usually complain about the string handling in C. I don't think I've ever even THOUGHT of the possibility of doing text processing in assembly ;D. What a headache ;D.
@wattage
@wattage 5 жыл бұрын
The OG (original greybeard) is back! I always, always love listening to Brian Kernighan. I admit to not knowing that ed should be pronounced eee-dee. One cool thing about ed is that if you master it, then sed and awk are a piece of cake. Like all things Unix. Thanks so very much Computerphile for having him on again. More, more please!!
@midimusicforever
@midimusicforever 2 жыл бұрын
The amount of time grep has saved through the time it has existed is staggering!
@aztlan-dev
@aztlan-dev 5 жыл бұрын
Always awesome to hear Brian Kernighan speak, thanks for doing the interview!
@peetiegonzalez1845
@peetiegonzalez1845 5 жыл бұрын
I had the honour of meeting BK when he was invited as a guest speaker to GCHQ in the early 90s when I was an intern. What an absolute legend.
@AndrewOxenburgh
@AndrewOxenburgh 2 жыл бұрын
It's amazing he can make it so accessible.
@MidNiteR32
@MidNiteR32 3 жыл бұрын
I just wish Dennis Ritchie were alive today to talk about his work. RIP
@jagardina
@jagardina 5 жыл бұрын
Fantastic. I've been using and administrating Unix since the mid-1980s back at Bellcore. It's always a pleasure to see one of the early developers talk about the history.
@GaryL3803
@GaryL3803 Жыл бұрын
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.
@ya64
@ya64 5 жыл бұрын
I love learning about stories like this! So many brilliant minds in the early era of computing! And here I am trying to align things correctly in a web page.
@usethefooorce
@usethefooorce 5 жыл бұрын
I love that he made his notes on dot matrix fanfold paper
@Nichetronix
@Nichetronix 4 жыл бұрын
Obviously, all these ED commands are still, in some form, in vi/Vim. Thank you Ken Thompson for grep!
@divit00
@divit00 4 жыл бұрын
SED
@lunasophia9002
@lunasophia9002 5 жыл бұрын
Love these videos with Prof. Kernighan. I sit in front of a Unix machine of one kind or another practically all day, every day. It's unique and wonderful to hear Prof. Kernighan's insights and thoughts on what forms the basis of the devices I use in every part of my life. Thank you for making these Unix history videos, and I am always happy to see more.
@sebsplatter914
@sebsplatter914 11 ай бұрын
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!
@PunkFuckUp
@PunkFuckUp 5 жыл бұрын
its crazy how well written those early unix programs were -- small, simple, performant, and to the point -- we still use many of them today nearly 40 years later. I can't say the same for any software written in the past 20 years.
@alerey4363
@alerey4363 2 жыл бұрын
they had to given the context of computing in its infancy, no screen, no more than 64KB memory, only a keyboard and a printer (and that was almost a luxury, the standard was perforated cards)
@leogama3422
@leogama3422 Жыл бұрын
Maybe pandoc (16 years) and ffmpeg (21 years now). Converting things is hard
@dmitripogosian5084
@dmitripogosian5084 Жыл бұрын
One of the same class id say is ssh
@HASHlRAMA
@HASHlRAMA 2 жыл бұрын
"Non of them were Ken Thompson" Meanwhile, Ken Thompson with a Wig in the classroom: "This is going to be a peace of cake."
@rmartinsjr
@rmartinsjr 5 жыл бұрын
Love these videos featuring Prof. Kernighan! It's first hand, living computer science knowledge and history!
@MT-zv3ie
@MT-zv3ie 5 жыл бұрын
More videos with Brian Kernighan please, I really enjoy his talks.
@KylePiira
@KylePiira 5 жыл бұрын
This guy is great, I'd like to see more from him.
@wPresti1
@wPresti1 5 жыл бұрын
its Brian Kernigha
@davidhaner
@davidhaner 2 жыл бұрын
He's one of the authors of C
@PaulPaulPaulson
@PaulPaulPaulson 5 жыл бұрын
Kernighan-Lin helped me a lot at work. Thank you!
@error.418
@error.418 5 жыл бұрын
What about Fiduccia-Mattheyses?
@williamlingenfelter4989
@williamlingenfelter4989 4 жыл бұрын
Computerphile is undoubtedly one of the best channels on KZbin!
@_Anna_Nass_
@_Anna_Nass_ Жыл бұрын
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 ❤️
@sebastianelytron8450
@sebastianelytron8450 5 жыл бұрын
Great! Real Expert Perspective!
@yorgle
@yorgle 5 жыл бұрын
Generated rich enjoyable product.
@yorgle
@yorgle 5 жыл бұрын
Go-on.... reply, Elytron... Please?
@yorgle
@yorgle 5 жыл бұрын
Gonna really expect perfection...
@kuyper
@kuyper 5 жыл бұрын
Grep real easy patterns
@rypedub7973
@rypedub7973 5 жыл бұрын
Your channel should literally be how to teach computers in school. I love this so much. I thought it was called gREP, not Grep. The history is fantastic! I've used this command so many times compiling software for various reasons. Thank you.
@xspager
@xspager 5 жыл бұрын
Nicholas Aranda The computer history museum have a lot of long (and kid of boring unfortunately) interviews with giants of computing
@jphanson
@jphanson 5 жыл бұрын
xspager more room for me to attend :-)
@Raiment57
@Raiment57 5 жыл бұрын
Well, since UNIX is case sensitive it is neither gREP nor Grep, but grep. :)
@ericc6820
@ericc6820 2 ай бұрын
I love learning things like this. It’s not only a great history lesson, but is so useful in understanding the functionality of the command itself. Thank you. 👏👏
@alanvitullo6613
@alanvitullo6613 5 жыл бұрын
One of the best videos recently!
@user-ov5nd1fb7s
@user-ov5nd1fb7s 5 жыл бұрын
"none of them were Ken Thompson", lol, so true.
@Vagelis_Prokopiou
@Vagelis_Prokopiou 5 жыл бұрын
Very nice and historically valuable video.
@Bitwise1024
@Bitwise1024 5 жыл бұрын
I use this tool every single day and was unaware of the story behind it. Thank you Mr. Kernighan!
@coolbrotherf127
@coolbrotherf127 Жыл бұрын
He was amazingly sharp and well spoken for being about 76 at the time of recording. His knowledge and experience just radiates from him.
@unvergebeneid
@unvergebeneid 5 жыл бұрын
Where the name "grep" came from? Why, from the verb "grepping through text" of course! .... Wait, what's that? That wasn't a word before? How _did_ people communicate back in the day?
@GonzoTehGreat
@GonzoTehGreat 5 жыл бұрын
Get a grep on yourself. It's nothing to grep about!
@thingsiplay
@thingsiplay 3 жыл бұрын
Same with Google. Nobody says "search", everyone says "Google" yourself. Before Google, everyone was finding. xD
@slpk
@slpk 5 жыл бұрын
You now HAVE TO do the origins of regular expressions
@khalidelgazzar
@khalidelgazzar 4 жыл бұрын
Amazing video. Describes how things slowly but surely evolved into the current super computing Era. Not to forget the gigantic efforts of Unix & C pioneers like Ken Thompson & Dennis Ritchie
@roygaya
@roygaya 5 жыл бұрын
Loved this video because it gave me an extra dimension of meaning and understanding to something so common and trivial as the program grep. Amazing explanation, btw!
@tc2241
@tc2241 5 жыл бұрын
Holy ****, that IS Brian Kernighan! Talk about eating some humble pie. Totally not worthy
@crogersdev
@crogersdev 4 жыл бұрын
Raise your hand if you use 'grep' in your everyday speech. "Grep the closet for your shoes, kids." "Grepped everywhere for my car keys, can't find them."
@brittanymarie8523
@brittanymarie8523 4 жыл бұрын
Emphatic. Eloquent. Brian Kernighan. 💕
@martinhorner642
@martinhorner642 2 жыл бұрын
Even being an avid, decades long toolbox command user (like cat, ed, sed, awk, tr, etc. including, ofc, grep) I cannot recall ever hearing this story and it's priceless. Thank you for putting this up.
@PaulPaulPaulson
@PaulPaulPaulson 5 жыл бұрын
Short answer starts at 7:55 (for later reference, you should still watch all of the video)
@marklandgraf7667
@marklandgraf7667 5 жыл бұрын
Thank you.
@rektal6741
@rektal6741 5 жыл бұрын
you da real mvp
@jwo7777777
@jwo7777777 5 жыл бұрын
Did you find this using a video version of GREP?
@ian_b
@ian_b 5 жыл бұрын
g/grep/p
@aditya8404
@aditya8404 5 жыл бұрын
g/re/p
@samberg3864
@samberg3864 5 жыл бұрын
Very interesting, I always just assumed it stood for "Get Regular Expression Pattern".
@ER_aka_RAM
@ER_aka_RAM 3 жыл бұрын
I hope anyone that watched was able to get to Seattle last year to see the UNIX@50 display at the Living Computers Museum... it was a dream come true and these videos complement it very well. Much thx!
@roopcharlie6264
@roopcharlie6264 2 жыл бұрын
most interesting video I watched over xmas, and the most powerful program ever written. I don't know how I've survive without it.
@AvailableUsernameTed
@AvailableUsernameTed 5 жыл бұрын
One of my fav all-time cartoons is the one that compares a group of cavemen with some computer programmers. Both groups exclaim 'grep , awk and mkdir'. It might have been in Kernighan's book. (edited bad spellcheck substitution)
@Yaxqb
@Yaxqb 5 жыл бұрын
Getting ken himself on this channel would be great
@esra_erimez
@esra_erimez 5 жыл бұрын
+1
@damejelyas
@damejelyas 5 жыл бұрын
Too late
@TheDavo10001
@TheDavo10001 5 жыл бұрын
They’d need a time machine or a ouija board
@almafuertegmailcom
@almafuertegmailcom 5 жыл бұрын
@@TheDavo10001 Buddy, Ken is alive and well. Well, not sure if well, he works at Google, but certainly alive. It was drc we sadly lost a few years ago.
@Clubcloudcomputing
@Clubcloudcomputing 4 жыл бұрын
@@almafuertegmailcom You mean dmr instead of drc? Yes, sad. I met them both personally and they were nice guys in their own peculiar ways.
@JohnnysaidWhat
@JohnnysaidWhat 5 жыл бұрын
This is so awesome. I loved this talk and learning about the history. Thank you for posting this
@mentatphilosopher
@mentatphilosopher 5 жыл бұрын
For anyone interested grep coded in C in the original UNIX consisted of two files: grep.c (135 NCSL) and regexp.h (371 NCSL)
@exlife9446
@exlife9446 4 жыл бұрын
oh, grep means: Globally search the lines to find out that match a regular expression pattern and print all of them;
@coffee115
@coffee115 5 жыл бұрын
grep saved my bacon countless times.
@BooBaddyBig
@BooBaddyBig 5 жыл бұрын
| grep bacon > save
@RamLaska
@RamLaska 5 жыл бұрын
grep, awk, and sed are the holy Trinity of Unix.
@error.418
@error.418 5 жыл бұрын
Rem Lesk: yes
@error.418
@error.418 5 жыл бұрын
jqbtube perl != unix
@CriminalMacabre
@CriminalMacabre 4 жыл бұрын
@Markus Glanzer baCRON?
@otcybersecurity6643
@otcybersecurity6643 4 жыл бұрын
Thank you for the story Prof Kernighan, well told!
@NinoM4sterChannel
@NinoM4sterChannel 5 жыл бұрын
Such an amazing story! Thanks for sharing!
@seanbirtwistle649
@seanbirtwistle649 5 жыл бұрын
these history lessons are some of your most important work. its an insight into computer culture you'll never read on Wikipedia or see in a Hollywood movie. its very cool
@TheFlyingScotsmanTV
@TheFlyingScotsmanTV 5 жыл бұрын
oh come on - don't leave us hanging... did any of the students manage it ?
@contrapasta2454
@contrapasta2454 5 жыл бұрын
If any one of them had he would have mentioned it.
@MitchRiedstra
@MitchRiedstra 5 жыл бұрын
Considering it was a computer science task in the early 90's I'd assume everyone taking the class were able to do it. grep isn't a complicated program by any means
@TonyHammitt
@TonyHammitt 5 жыл бұрын
The next week's challenge was probably to write the ed script to automatically change the 1800 lines of ed into the grep program. That'd be pretty evil...
@karlkastor
@karlkastor 5 жыл бұрын
He said they were given the ed source code and earlier he said ed included a regex search. So they already had a regex parser. The rest shouldn't be too hard.
@seraphina985
@seraphina985 5 жыл бұрын
+Karl Kastor Indeed if anything it's a lot of stripping down what is there since grep gets rid of all the editing stuff and just focuses on the printing part. Thus of course how sed ended up coming about providing the full functionality of ed but of course with the ability to work on streamed or pipelined input the latter one in particular making it still a staple even today for text manipulation in shell scripts.
@imransyed8676
@imransyed8676 4 жыл бұрын
Absolute genius !!! It's a privilege to watch such people talking about linux and Unix
@raja.t.2008
@raja.t.2008 4 жыл бұрын
This is the first video I see on this channel. This is the most beautiful video I have ever seen on recent times. Subscribed ofcourse :)
@afiqzx
@afiqzx 5 жыл бұрын
Since watching this video my power limit has increased by 25%
@markiangooley
@markiangooley 5 жыл бұрын
I remember a parody of “The Sounds of Silence” with the immortal lines: Sew on this handle that I might schlep you/ Change your permissions that I might grep you...
@tigerresearch2665
@tigerresearch2665 4 жыл бұрын
"Change your permissions that I might grep you" hmm.. where there any privilege escalation bugs in grep? :)
@robbybankston4238
@robbybankston4238 2 ай бұрын
Grep is one of the best tools I ever learned back in my university days and I have been using it for about 28 years. I even use native binary ports on Windows when I use that platform.
@JohnMcCulloch75
@JohnMcCulloch75 3 жыл бұрын
Wow!!!!! Simply delightful to hear this story.
@DrMcCoy
@DrMcCoy 5 жыл бұрын
ed is the standard text editor
@DrMcCoy
@DrMcCoy 5 жыл бұрын
How appropriate, you fight like a cow
@__-to3hq
@__-to3hq 5 жыл бұрын
wow grep was written overnight!?
@asmodin88
@asmodin88 5 жыл бұрын
In Assembler even. I am baffled how that is even possible. Guess you have to be Ken Thompson for that :D
@okuno54
@okuno54 5 жыл бұрын
To be fair, if you know what you're going for, it a fairly simple program transformation: remove features and then loop over files. Of course, 70's-era assembly may not have made that easy...
@__-to3hq
@__-to3hq 5 жыл бұрын
lol yea assembly code sounds like a mountain of 0 and 1's :D
@pDaleC
@pDaleC 5 жыл бұрын
Nope--that's machine code. ;)
@smorrow
@smorrow 5 жыл бұрын
Unix was written in a month - a week for the kernel, a week for the filesystem, a week for the shell (but the original Unix shell was not _also_ a _language_ as it is today - that came later with the PWB shell), and a fourth week for init, echo, cat, ed, as, and so forth. It didn't have pipes, diff, certainly not troff, and fork-exec wasn't invented yet.
@gingatim
@gingatim 4 жыл бұрын
This kind of thing is invaluable. I use grep multiple times a day, every day and this really ties a piece of software into a real life problem that was solved. I could sit for hours listening to this kind of thing.
@SiddharthKulkarniN
@SiddharthKulkarniN 5 жыл бұрын
A fascinating look into the history. Thanks for posting.
@FelipeCotti
@FelipeCotti 5 жыл бұрын
"ed was the standard text editor" IT STILL IS.
@menachemsalomon
@menachemsalomon 5 жыл бұрын
Felipe Cotti By definition, of course. Says so right in the man page...
@FelipeCotti
@FelipeCotti 5 жыл бұрын
Menachem Salomon by definition, by conviction, and by heart.
@sokolum
@sokolum 4 жыл бұрын
vi
@thenayancat8802
@thenayancat8802 5 жыл бұрын
How did the students do on the assignment?
@smorrow
@smorrow 5 жыл бұрын
It's literally just writing a new main() and deleting every function you end up not using...
@thenayancat8802
@thenayancat8802 5 жыл бұрын
Fair enough, I'm not familiar with the source of grep tbh
@ewenchan1239
@ewenchan1239 2 жыл бұрын
If you haven't done so already, you need to record and make a "history of..." series of videos because your knowledge on these matters and subjects is invaluable to anybody/everybody who uses it. (As a sidenote, my family and I now are deeply engrossed in Hamilton: The Musical and so my 6-year-old son is starting to learn about The Federalist Papers and it is interesting how that intersected with computer science which gave birth to g/re/p.) That's such a cool story and I'm so glad that you were able to share it.
@PJ-he5zk
@PJ-he5zk 2 жыл бұрын
Explanations like this are valuable for understanding the context of the things students are learning in modern cs.
@BlazertronGames
@BlazertronGames 5 жыл бұрын
wow, g/re/p
@jurgentreep
@jurgentreep 5 жыл бұрын
9:44 :)
@giftedoneaz
@giftedoneaz 3 жыл бұрын
This is an awesome story. Grep is still an amazing tool I use almost every day.
@rhymereason3449
@rhymereason3449 5 жыл бұрын
What an honor getting to listen to some of the greatest influences in computer science. I still have his original book he did with Dennis Richie - _The C Programming Language_. Looking at the editor ed you can certainly see where vi was spawned from as well.
@akapo98
@akapo98 5 жыл бұрын
I always thought it came from "to grab something" .grab, grep same thing but with a tech twist
@PaulioBee
@PaulioBee 5 жыл бұрын
64k was not that shabby back in the day!
@CreachterZ
@CreachterZ 2 жыл бұрын
I absolutely love your stories! Much like Unix time, I started out in 1970.
@conelatilot
@conelatilot 4 жыл бұрын
Brian is one of my four favorites of the profs / researchers/..
@Cygnus0lor
@Cygnus0lor 5 жыл бұрын
"So he left and came back the next day with 1800 lines of C"... GG
@johnpope4824
@johnpope4824 3 жыл бұрын
Actually, PDP 11 assembly code. C hadn't been created yet.
@jafaboarder
@jafaboarder 5 жыл бұрын
5:06 flipping everyone off
@PhG1961
@PhG1961 5 жыл бұрын
Interesting and entertaining video. Finally I know where GREP comes from. I'll never forget that.
@hpp6116
@hpp6116 5 жыл бұрын
Very nice and interesting video! I really would like to see more of this kind of videos.
@irjanolsen4684
@irjanolsen4684 5 жыл бұрын
So I'm guessing sed came from ed? Would like to see a comment or video about this.
@TheWyleECoyote
@TheWyleECoyote 5 жыл бұрын
ed; editor, sed; stream editor nuf said
@AlqGo
@AlqGo 5 жыл бұрын
And awk was inspired by ed or sed
@kd1s
@kd1s 5 жыл бұрын
You haven't lived until you've done back references in regex. And I wonder - sed or Stream Editor seems derivative of ed.
@andurilan
@andurilan 5 жыл бұрын
$( whatever number ) Is how you get a reference to capture group in RE.
@johnfrancisdoe1563
@johnfrancisdoe1563 5 жыл бұрын
Anduin Arilan Or \whatever number.
@jurcenko48
@jurcenko48 5 жыл бұрын
busi magen great explanation. There have bee n so many times when I was looking to solve a problem using regex where this would be ideal. You learn every day
@asshole9191
@asshole9191 5 жыл бұрын
Well, technically those are more powerful than regex... A regular grammar is one where all rules follow the this pattern: Non-terminal -> non-terminal terminal Non-terminal -> terminal The result of the first can be swapped but, iirc, all rules following this pattern must have the terminal in the same side. Because of this, it is impossible for regex to check if both sides of an expression match the same arbitrary string. This means that mathematical expressions are not in regex because you cannot make sure that all open parentheses are closed.
@eleanorsilver8291
@eleanorsilver8291 5 жыл бұрын
sed is indeed the editor that came after ed. basically: ed > sed > vi > vim. from the GNU handbook: sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). While in some ways similar to an editor which permits scripted edits (such as ed), sed works by making only one pass over the input(s), and is consequently more efficient. But it is sed’s ability to filter text in a pipeline which particularly distinguishes it from other types of editors.
@reoire843
@reoire843 2 жыл бұрын
2:36 "Remember PAPER? Zoom down here, you can see PAPER." 😆
@squirlmy
@squirlmy 2 жыл бұрын
I think he might have originally intended to specify "tractor feed paper", because that is now never used, but commonplace for computers until the late 80s. I remember using Vax terminals in university library in '88. Often people would accidentally print far more than they intended and there was often a long walk between the terminals and the printer, and occasionally you'd see students running through the library to enter a "break" command on their terminal. Meanwhile the feed would pile up in a stack below the printer. Paper recycling was uncommon, so it was pure waste.
@csadler
@csadler 2 жыл бұрын
Oh my. Rewind. I remember such pleasure of tying a long cmd line with several 'greps' piped together finding the exact data I needed.
Coffee with Brian Kernighan - Computerphile
28:31
Computerphile
Рет қаралды 187 М.
Самый большой бутер в столовке! @krus-kos
00:42
Кушать Хочу
Рет қаралды 5 МЛН
ISSEI funny story 😂😂😂Strange World 🌏 Green
00:27
ISSEI / いっせい
Рет қаралды 81 МЛН
How TOR Works- Computerphile
14:19
Computerphile
Рет қаралды 1,7 МЛН
Regular Expressions - Computerphile
17:19
Computerphile
Рет қаралды 236 М.
Where did Bytes Come From? - Computerphile
11:31
Computerphile
Рет қаралды 473 М.
Cracking Enigma in 2021 - Computerphile
21:20
Computerphile
Рет қаралды 2,4 МЛН
UNIX Special: Profs Kernighan & Brailsford - Computerphile
28:16
Computerphile
Рет қаралды 326 М.
How Secure Shell Works (SSH) - Computerphile
9:20
Computerphile
Рет қаралды 805 М.
Tmux has forever changed the way I write code.
13:30
Dreams of Code
Рет қаралды 865 М.
Ken Thompson interviewed by Brian Kernighan at VCF East 2019
1:03:51
Vintage Computer Federation
Рет қаралды 314 М.
Characters, Symbols and the Unicode Miracle - Computerphile
9:37
Computerphile
Рет қаралды 1,9 МЛН
Самый большой бутер в столовке! @krus-kos
00:42
Кушать Хочу
Рет қаралды 5 МЛН