Where GREP Came From - Computerphile

Поділитися
Вставка
  • Опубліковано 22 лис 2024

КОМЕНТАРІ • 1 тис.

  • @toreanstudios607
    @toreanstudios607 5 років тому +3263

    Students: this project is impossible
    Professor Kernighan: KEN THOMPSON built this GREP in A CAVE with a BOX OF SCRAPS

    • @Fromatic
      @Fromatic 5 років тому +288

      Students: but.. we're not.. Ken Thompson..

    • @guestimator121
      @guestimator121 5 років тому +116

      @@Fromatic Well, no one's perfect, except for Ken Thompson

    • @daffy1981
      @daffy1981 5 років тому +25

      @@Fromatic Exactly.. Bruce Lee used to do pushups with on single finger..

    • @vibhorsteele
      @vibhorsteele 4 роки тому +47

      Iron man reference isn't it?

    • @professorfontanez
      @professorfontanez 4 роки тому +83

      @@Fromatic Professor Kernighan: And that's why you have a week to complete the assignment and not just a few hours.

  • @davidgillies620
    @davidgillies620 6 років тому +3563

    Not being Ken Thompson is a struggle every working software engineer has to contend with.

    • @iAmTheSquidThing
      @iAmTheSquidThing 6 років тому +175

      Except Ken Thompson.

    • @cbernier3
      @cbernier3 6 років тому +20

      nope, he's retired.

    • @iAmTheSquidThing
      @iAmTheSquidThing 6 років тому +23

      cbernier3 - Last I heard he was still doing some work for Google.

    • @cbernier3
      @cbernier3 6 років тому +9

      They say he retired from Google.

    • @sumitshresth
      @sumitshresth 6 років тому +4

      hmm jeff dean disagrees

  • @Goodvvine
    @Goodvvine 6 років тому +2770

    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 6 років тому +15

      I'm not Clay Thompson. Oops, wrong interview

    • @ruochenlin7994
      @ruochenlin7994 6 років тому +3

      Hired.

    • @Thallod
      @Thallod 5 років тому +3

      @@u.v.s.5583 I'm not Clay Thompson, but 20 dollars is 20 dollars.

    • @charles-y2z6c
      @charles-y2z6c 5 років тому +8

      My greatest weakness is i do not think i have any weakness.

    • @brittanymarie8523
      @brittanymarie8523 5 років тому +2

      Absolutely the best 🤣

  • @dgollas
    @dgollas 6 років тому +857

    It's great to watch and hear legendary computer scientists talk about such fundamental and ubiquitous tools.

  • @bjornmu
    @bjornmu 6 років тому +1134

    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 6 років тому +30

      My personal favorites are vgrep and vdiff, just to specify you're doing it by eye.

    • @ThePharphis
      @ThePharphis 6 років тому +4

      diff?

    • @jasonbiegel5
      @jasonbiegel5 5 років тому +38

      "make your code greppable"

    • @amyshaw893
      @amyshaw893 5 років тому +31

      i recently asked some friends if there was a way to "grep through messenger history"

    • @OpenGL4ever
      @OpenGL4ever 5 років тому +15

      What i like most at ebooks is the fact, that they are greppable.

  • @crcrewso
    @crcrewso 6 років тому +467

    “And of course they all had one disadvantage, None of them were Ken Thompson”
    Oh My!!!! Best line of the series.

    • @ylstorage7085
      @ylstorage7085 4 роки тому +6

      both bill gates and mark zuk got that assignment.
      (fake history)

    • @Coillcara
      @Coillcara 3 роки тому +1

      @@ylstorage7085 Bill Gates is a genius, just not in programming.

    • @corey333p
      @corey333p 2 роки тому +3

      "grave" disadvantage!

  • @piotrarturklos
    @piotrarturklos 6 років тому +1234

    This video is such a gem! Computerphile is making a great contribution to the history of computer science.

  • @denravonska
    @denravonska 3 роки тому +391

    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 3 роки тому +20

      I always mentally converted it into the dialectal "greppa [tag i]" -- roughly synonymous with "seize hold of."

    • @dominikkuzila
      @dominikkuzila 3 роки тому +26

      In Slovak it just means grapefruit lol

    • @BobWitlox
      @BobWitlox 3 роки тому +11

      In bad Dutch English, grab is pronounced as grep. So mentally I've always thought of grabbing text from input.

    • @jek__
      @jek__ 2 роки тому +2

      Like grepping a needle in a haystack!

    • @TheArrowedKnee
      @TheArrowedKnee 2 роки тому +1

      In Norwegian we also have "Å gripe", meaning "To grab", which sounds very close to grep

  • @bool2max
    @bool2max 6 років тому +538

    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 6 років тому +31

      /applause
      But your avatar is very fitting.

    • @williambarela2791
      @williambarela2791 6 років тому +43

      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 6 років тому +3

      a wild kripp has been spotted!

    • @mmaepo
      @mmaepo 6 років тому +4

      Same. Mind blown.

    • @Outfrost
      @Outfrost 6 років тому +14

      Oh yeah, same. Someone mentioned Prof. Kernighan in the comments, I did a double take, then slowly realised who's talking in the video.

  • @rhymereason3449
    @rhymereason3449 6 років тому +74

    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 роки тому +1

      For context:
      #programmers to develop IBM OS360 = ?
      #programmers to develop Windows / OS/2 = ?
      #programmers to develop Lisa = ?
      and then...
      #programmers to develop Linux = :) ?

  • @vegidio
    @vegidio 4 роки тому +64

    This guy is one of the living legends of computer science! I still have his book at home

  • @imranariffin2688
    @imranariffin2688 5 років тому +96

    "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 4 роки тому +10

      @Joshua Murphy converting to grep?

    • @陳秉軒-c9b
      @陳秉軒-c9b 4 роки тому +7

      @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 4 роки тому +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 3 роки тому +5

      @@ruadrift not with memory limitations at the time

    • @edwardmacnab354
      @edwardmacnab354 8 місяців тому

      @@陳秉軒-c9b so the trick was figuring out that grep was just g/re/p ?

  • @BrunoRegno
    @BrunoRegno 6 років тому +96

    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.

  • @xkguy
    @xkguy 5 років тому +371

    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 5 років тому +19

      xkguy, … and you were right.

    • @eminusipi
      @eminusipi 5 років тому +21

      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 роки тому +13

      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 4 роки тому +1

      You learned FORTRAN from John Backus? 😮

    • @TAP7a
      @TAP7a 3 роки тому +8

      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

  • @skaruts
    @skaruts 6 років тому +465

    You don't see this quality content on TV.

    • @darylallen2485
      @darylallen2485 5 років тому +20

      There's no naked women, beer, or men acquiring brain damage. In America, that means audience fell asleep.

    • @baruchben-david4196
      @baruchben-david4196 5 років тому +9

      I don't even own a TV.

    • @jtgdyt2
      @jtgdyt2 5 років тому +8

      ...unless you cast UA-cam to your TV.

    • @SmartWarthog
      @SmartWarthog 5 років тому +3

      Reminder that Computer Chronicles was a TV show in the 80's.

    • @TVIDS123
      @TVIDS123 4 роки тому

      SmartWarthog so... 30 years ago? Not now then lol

  • @aner_bda
    @aner_bda 6 років тому +52

    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 3 роки тому

      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 8 місяців тому

      @@jcf20010 i love standardization

  • @onemanenclave
    @onemanenclave 5 років тому +157

    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 4 роки тому +28

      @@new-lviv This aged quite well. 2020 has been quite roaring

    • @cipher3966
      @cipher3966 3 роки тому +7

      You guys are so 2010s

    • @harshsharma03
      @harshsharma03 2 роки тому

      @@kebien6020 2022 has been even more roaring so far.

    • @dawnwatching6382
      @dawnwatching6382 2 роки тому

      Very soon 1975 will be 50 years ago! That's crazy.

  • @midimusicforever
    @midimusicforever 3 роки тому +13

    The amount of time grep has saved through the time it has existed is staggering!

  • @mikeklaene4359
    @mikeklaene4359 6 років тому +83

    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 6 років тому +4

      having had been introduced?

    • @markgreen66
      @markgreen66 5 років тому +6

      Did you get the job?

    • @santiagoserna4
      @santiagoserna4 3 роки тому +3

      So you nailed the interview and now you're the owner right?

    • @mikeklaene4359
      @mikeklaene4359 3 роки тому +11

      @@markgreen66 Yes I did. I was most surprised because of my age. I stayed there until turning 68.

    • @mikeklaene4359
      @mikeklaene4359 3 роки тому +8

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

  • @GaryL3803
    @GaryL3803 2 роки тому +2

    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.

  • @jagardina
    @jagardina 5 років тому +6

    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.

  • @aztlan-dev
    @aztlan-dev 6 років тому +35

    Always awesome to hear Brian Kernighan speak, thanks for doing the interview!

    • @peetiegonzalez1845
      @peetiegonzalez1845 6 років тому

      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.

  • @shavenith4369
    @shavenith4369 6 років тому +100

    ...and the original grep was written in PDP-11 assembly language...!> Overnight.....

    • @johnyang799
      @johnyang799 5 років тому +6

      @jqbtube The fact that it's in assembly language makes it as impossible.

    • @jtgdyt2
      @jtgdyt2 5 років тому +13

      @@johnyang799 Not if you know assembly language.

    • @kenmolinaro
      @kenmolinaro 5 років тому +11

      @@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 4 роки тому +1

      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.

  • @benjamingeiger
    @benjamingeiger 6 років тому +208

    A lot of the aspects of ed that are covered here still work in vi (or even vim).

    • @farischugthai5598
      @farischugthai5598 6 років тому +78

      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 6 років тому +3

      Faris Chugthai Don't forget cousins like CP/M's ED, or IBM's XEDIT.

    • @3nertia
      @3nertia 6 років тому +4

      They can also work directly on the command line in BASH x]

    • @tomihawk01
      @tomihawk01 6 років тому +40

      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 років тому +14

      @@tomihawk01
      And in the end, nano won.
      (me starting a new war. SCNR)

  • @NunoLopes99
    @NunoLopes99 6 років тому +73

    I'm a simple man, I see a video of Brian Kernighan and I click it.

  • @ya64
    @ya64 6 років тому +12

    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.

  • @WCL31986
    @WCL31986 4 роки тому +3

    Computerphile is undoubtedly one of the best channels on UA-cam!

  • @coolbrotherf127
    @coolbrotherf127 2 роки тому

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

  • @MidNiteR32
    @MidNiteR32 3 роки тому +17

    I just wish Dennis Ritchie were alive today to talk about his work. RIP

  • @_Anna_Nass_
    @_Anna_Nass_ 2 роки тому +1

    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 ❤️

  • @wattage
    @wattage 6 років тому +26

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

  • @sebsplatter914
    @sebsplatter914 Рік тому +1

    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!

  • @usethefooorce
    @usethefooorce 6 років тому +11

    I love that he made his notes on dot matrix fanfold paper

  • @gingatim
    @gingatim 5 років тому +2

    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.

  • @KylePiira
    @KylePiira 6 років тому +21

    This guy is great, I'd like to see more from him.

    • @wPresti1
      @wPresti1 6 років тому +2

      its Brian Kernigha

    • @davidhaner
      @davidhaner 3 роки тому +1

      He's one of the authors of C

  • @mentatphilosopher
    @mentatphilosopher 6 років тому +1

    For anyone interested grep coded in C in the original UNIX consisted of two files: grep.c (135 NCSL) and regexp.h (371 NCSL)

  • @Nichetronix
    @Nichetronix 5 років тому +20

    Obviously, all these ED commands are still, in some form, in vi/Vim.
    Thank you Ken Thompson for grep!

  • @ER_aka_RAM
    @ER_aka_RAM 4 роки тому

    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!

  • @seanbirtwistle649
    @seanbirtwistle649 6 років тому +3

    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

  • @robbybankston4238
    @robbybankston4238 9 місяців тому

    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.

  • @unvergebeneid
    @unvergebeneid 6 років тому +89

    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 6 років тому +7

      Get a grep on yourself. It's nothing to grep about!

    • @thingsiplay
      @thingsiplay 3 роки тому +5

      Same with Google. Nobody says "search", everyone says "Google" yourself. Before Google, everyone was finding. xD

  • @lunasophia9002
    @lunasophia9002 6 років тому +1

    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.

  • @rypedub7973
    @rypedub7973 6 років тому +17

    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 6 років тому +1

      Nicholas Aranda The computer history museum have a lot of long (and kid of boring unfortunately) interviews with giants of computing

    • @jphanson
      @jphanson 6 років тому +1

      xspager more room for me to attend :-)

    • @Raiment57
      @Raiment57 6 років тому +2

      Well, since UNIX is case sensitive it is neither gREP nor Grep, but grep. :)

  • @MT-zv3ie
    @MT-zv3ie 6 років тому +1

    More videos with Brian Kernighan please, I really enjoy his talks.

  • @PaulPaulPaulson
    @PaulPaulPaulson 6 років тому +234

    Short answer starts at 7:55
    (for later reference, you should still watch all of the video)

  • @csadler
    @csadler 3 роки тому

    Oh my. Rewind. I remember such pleasure of tying a long cmd line with several 'greps' piped together finding the exact data I needed.

  • @user-ov5nd1fb7s
    @user-ov5nd1fb7s 6 років тому +29

    "none of them were Ken Thompson", lol, so true.

  • @peterlewerin4213
    @peterlewerin4213 2 роки тому +1

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

  • @sebastianelytron8450
    @sebastianelytron8450 6 років тому +153

    Great! Real Expert Perspective!

    • @yorgle
      @yorgle 6 років тому +4

      Generated rich enjoyable product.

    • @yorgle
      @yorgle 6 років тому +1

      Go-on.... reply, Elytron... Please?

    • @yorgle
      @yorgle 6 років тому +3

      Gonna really expect perfection...

    • @kuyper
      @kuyper 6 років тому +2

      Grep real easy patterns

  • @martinhorner642
    @martinhorner642 3 роки тому

    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.

  • @HASHlRAMA
    @HASHlRAMA 3 роки тому +5

    "Non of them were Ken Thompson"
    Meanwhile, Ken Thompson with a Wig in the classroom: "This is going to be a peace of cake."

  • @mina86
    @mina86 6 років тому

    0:39 - M-x mark-whole-buffer RET M-x keep-lines RET RET

  • @samberg3864
    @samberg3864 6 років тому +3

    Very interesting, I always just assumed it stood for "Get Regular Expression Pattern".

  • @shobithchadagapandeshwar9764
    @shobithchadagapandeshwar9764 6 років тому +1

    Grep is probably the greatest command in my opinion and it was invented overnight. Amazing insight , Ken Thompson is a true programming genius and now he's developing the GO language

    • @Asdayasman
      @Asdayasman 5 років тому

      Don't forget Rob Pike.

    • @utl94
      @utl94 Рік тому

      grep wasn't really invented overnight. There is an excellent "fireside chat" between Ken Thompson and Brian Kernighan on this site where Ken is giving some details. Basically, Ken had grep lying around when department head Doug McIlroy asked for a program with such capabilities. Ken gave himself overnight to clean up the program and then delivered, hence it seemed like an overnight development. Ken is still a wizard though and I highly recommend the interview, it is the one from VCF East in 2019. It's a gem!

  • @Vagelis_Prokopiou
    @Vagelis_Prokopiou 6 років тому +3

    Very nice and historically valuable video.

  • @ericc6820
    @ericc6820 9 місяців тому

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

  • @tc2241
    @tc2241 5 років тому +18

    Holy ****, that IS Brian Kernighan! Talk about eating some humble pie. Totally not worthy

  • @JohnWick-ep7qr
    @JohnWick-ep7qr 4 роки тому +1

    Notice he does not stutter once or use the filler 'aaaa' to search for words. Very fluent speaker. Hats off.

    • @stargazer7644
      @stargazer7644 4 роки тому

      I thought that was just a "normal" speaker.

  • @reoire843
    @reoire843 2 роки тому +3

    2:36 "Remember PAPER? Zoom down here, you can see PAPER."
    😆

    • @squirlmy
      @squirlmy 2 роки тому +1

      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.

  • @Bitwise1024
    @Bitwise1024 6 років тому

    I use this tool every single day and was unaware of the story behind it. Thank you Mr. Kernighan!

  • @PaulPaulPaulson
    @PaulPaulPaulson 6 років тому +5

    Kernighan-Lin helped me a lot at work. Thank you!

    • @error.418
      @error.418 6 років тому +2

      What about Fiduccia-Mattheyses?

  • @TheCynicalDude_
    @TheCynicalDude_ 5 років тому

    I use grep all the time... probably most often to search for running processes via: ps aux|grep or when looking for a file in a directory with a lot of files: ls -lhat|grep ... the uses go on and on though. You can go further in depth and look for files that are open or being used by a program. lsof|grep

  • @exlife9446
    @exlife9446 5 років тому +8

    oh, grep means: Globally search the lines to find out that match a regular expression pattern and print all of them;

  • @cesarqueti2073
    @cesarqueti2073 3 роки тому

    I don't recall having watched a video with professor Kernighan, he's a great storyteller

  • @AvailableUsernameTed
    @AvailableUsernameTed 6 років тому +13

    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)

  • @imransyed8676
    @imransyed8676 4 роки тому

    Absolute genius !!! It's a privilege to watch such people talking about linux and Unix

  • @Yaxqb
    @Yaxqb 6 років тому +118

    Getting ken himself on this channel would be great

    • @esra_erimez
      @esra_erimez 6 років тому +4

      +1

    • @damejelyas
      @damejelyas 6 років тому +5

      Too late

    • @TheDavo10001
      @TheDavo10001 5 років тому +5

      They’d need a time machine or a ouija board

    • @user-sn8oe5sb1b
      @user-sn8oe5sb1b 5 років тому +9

      @@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 5 років тому +3

      @@user-sn8oe5sb1b You mean dmr instead of drc? Yes, sad. I met them both personally and they were nice guys in their own peculiar ways.

  • @PJ-he5zk
    @PJ-he5zk 2 роки тому

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

  • @slpk
    @slpk 6 років тому +5

    You now HAVE TO do the origins of regular expressions

  • @rdvqc
    @rdvqc 5 років тому

    A wonderful tidbit. I never know where the name came from but even retired after 50 years in the biz, I use it most days.

  • @crogersdev
    @crogersdev 5 років тому +7

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

  • @stephenparallox
    @stephenparallox 5 років тому +1

    programming grep in c is a nice little project. when I was learning unix, the professor had us write our own ls command in c... fun little project actually.

    • @asicaery7881
      @asicaery7881 4 роки тому

      That is so easy you literally get a pointer to current directory and loop through the files printing their names.

  • @TheFlyingScotsmanTV
    @TheFlyingScotsmanTV 6 років тому +78

    oh come on - don't leave us hanging... did any of the students manage it ?

    • @contrapasta2454
      @contrapasta2454 6 років тому +14

      If any one of them had he would have mentioned it.

    • @MitchRiedstra
      @MitchRiedstra 6 років тому +44

      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 6 років тому +14

      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 6 років тому +25

      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 6 років тому +2

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

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

  • @DrMcCoy
    @DrMcCoy 6 років тому +14

    ed is the standard text editor

    • @DrMcCoy
      @DrMcCoy 6 років тому +1

      How appropriate, you fight like a cow

  • @rmartinsjr
    @rmartinsjr 6 років тому +1

    Love these videos featuring Prof. Kernighan! It's first hand, living computer science knowledge and history!

  • @coffee115
    @coffee115 6 років тому +169

    grep saved my bacon countless times.

    • @BooBaddyBig
      @BooBaddyBig 6 років тому +15

      | grep bacon > save

    • @RamLaska
      @RamLaska 6 років тому +18

      grep, awk, and sed are the holy Trinity of Unix.

    • @error.418
      @error.418 6 років тому +1

      Rem Lesk: yes

    • @error.418
      @error.418 6 років тому +10

      jqbtube perl != unix

    • @CriminalMacabre
      @CriminalMacabre 5 років тому +1

      @Markus Glanzer baCRON?

  • @giftedoneaz
    @giftedoneaz 4 роки тому +1

    This is an awesome story. Grep is still an amazing tool I use almost every day.

  • @__-to3hq
    @__-to3hq 6 років тому +34

    wow grep was written overnight!?

    • @asmodin88
      @asmodin88 6 років тому +31

      In Assembler even. I am baffled how that is even possible. Guess you have to be Ken Thompson for that :D

    • @okuno54
      @okuno54 6 років тому +7

      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 6 років тому +1

      lol yea assembly code sounds like a mountain of 0 and 1's :D

    • @pDaleC
      @pDaleC 6 років тому +12

      Nope--that's machine code. ;)

    • @smorrow
      @smorrow 6 років тому +13

      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.

  • @tibfulv
    @tibfulv 5 років тому

    ed still exists, by the way. There's even a GNU version, and its direct descendant vi has a thousand implementations, some even with the ex part. So anyone can try out g//p.

  • @markiangooley
    @markiangooley 6 років тому +6

    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 5 років тому

      "Change your permissions that I might grep you" hmm.. where there any privilege escalation bugs in grep? :)

  • @ukaszGelChulo
    @ukaszGelChulo 3 роки тому

    grep and | (pipe) are my two most often used commands in linux/unix - can't live without them :D

  • @afiqzx
    @afiqzx 5 років тому +5

    Since watching this video my power limit has increased by 25%

  • @khalidelgazzar
    @khalidelgazzar 5 років тому +1

    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

  • @PaulioBee
    @PaulioBee 6 років тому +3

    64k was not that shabby back in the day!

  • @conelatilot
    @conelatilot 4 роки тому

    Brian is one of my four favorites of the profs / researchers/..

  • @BlazertronGames
    @BlazertronGames 6 років тому +45

    wow, g/re/p

  • @elginbeloy6205
    @elginbeloy6205 3 роки тому +2

    As a newer coder that used Linux as his primary workstation, I only really grep STDOUT, otherwise I use the IDE (which of course also uses REGEX). Super cool to know the history though, and I cannot imagine how helpful this was initially.

  • @FelipeCotti
    @FelipeCotti 6 років тому +7

    "ed was the standard text editor"
    IT STILL IS.

    • @menachemsalomon
      @menachemsalomon 6 років тому

      Felipe Cotti By definition, of course. Says so right in the man page...

    • @FelipeCotti
      @FelipeCotti 6 років тому +1

      Menachem Salomon by definition, by conviction, and by heart.

    • @sokolum
      @sokolum 4 роки тому

      vi

  • @rhymereason3449
    @rhymereason3449 6 років тому +1

    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.

  • @jurgentreep
    @jurgentreep 6 років тому +19

    9:44 :)

  • @jonassteinberg3779
    @jonassteinberg3779 5 років тому

    Wow! I knew what grep's acronym stood for, but had no idea of its origin. Incredible!

  • @thenayancat8802
    @thenayancat8802 6 років тому +4

    How did the students do on the assignment?

    • @smorrow
      @smorrow 6 років тому +1

      It's literally just writing a new main() and deleting every function you end up not using...

    • @thenayancat8802
      @thenayancat8802 6 років тому

      Fair enough, I'm not familiar with the source of grep tbh

  • @shorttimer874
    @shorttimer874 6 років тому

    Worked for a company that kept a database of properties and contacts at those properties using a text file, a Bourne script, and grep on a SCO Xenix systerm. Very fast, could be searched for something anywhere in a line rather than field specific. The script added lines, deleted lines, edited lines by replacing them, and passed the search criteria to grep, which was much easier than teaching someone to use vi to access the file, though that would work also.

  • @Cygnus0lor
    @Cygnus0lor 6 років тому +6

    "So he left and came back the next day with 1800 lines of C"...
    GG

    • @johnpope4824
      @johnpope4824 4 роки тому +1

      Actually, PDP 11 assembly code. C hadn't been created yet.

  • @basbastian2998
    @basbastian2998 6 років тому +1

    grep and ed both are great. Stil use them on an daily basis.
    And with all those small linux shell tools like "vi[m]" "wc" "xargs" "sed" "sort" "uniq" and many more. Combine it with pipes, and I have faster results than the rest with their fancy scripts in python and ruby.
    It took me a while to learn it (from some oldtimers) but are really grateful I did. A real time saver.

  • @akapo98
    @akapo98 6 років тому +4

    I always thought it came from "to grab something" .grab, grep same thing but with a tech twist

  • @sundareshvenugopal6575
    @sundareshvenugopal6575 3 роки тому

    The one place where wildcards are not joker's or swear words but part of regular expressions, Unix. How can you not love such a renegade system ?

  • @jafaboarder
    @jafaboarder 5 років тому +3

    5:06 flipping everyone off

  • @eliemaamary8679
    @eliemaamary8679 6 років тому +1

    *Slaps roof of Brian Kernighan*
    *This bad boy can hold so much history about computing*