Linux Command Line Pipes and Redirection

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

ความคิดเห็น • 68

  • @gbuwally6326
    @gbuwally6326 4 ปีที่แล้ว +49

    I’ve been doing Unix for 30+ years and went into this thinking “what could he teach me?” Thank you for always high quality content.

  • @thingsiplay
    @thingsiplay 4 ปีที่แล้ว +46

    I wonder how fast the redirection works with The new 128 core Intel Core i14-9942KX?

  • @isjav08
    @isjav08 4 ปีที่แล้ว +9

    Great explanations! Some extra stuff
    &>/dev/null
    And being able to just write it fully
    2>/dev/stdout
    1>/dev/stderr

  • @trevorkruse449
    @trevorkruse449 4 ปีที่แล้ว +10

    Great video man. One thing I would like to see more of is real world examples. But, that's just how I learn.

  • @ScottSteely
    @ScottSteely 4 ปีที่แล้ว +2

    Thanks, Engineer Man. Pipes are really usefully for trying to chase down some of those pesky errors that only appear for a second then disappear.

  • @RichardBronosky
    @RichardBronosky 4 ปีที่แล้ว +2

    I have been using everything you described here and I’m still glad I watched it.

  • @binbashbuddy
    @binbashbuddy 4 ปีที่แล้ว +1

    Another example of redirect would be program1 1> out.result 2> out.err, which would give you the results and any errors in two different files.

  • @therealmaku
    @therealmaku 4 ปีที่แล้ว

    great vids, pls do a video suggesting linux learning resources like books, courses, videos, etc. videos are well done and no bs, no fluff, this is much appreciated

  • @amarboldbatzorig7313
    @amarboldbatzorig7313 7 หลายเดือนก่อน

    Great video. Straight to the point and clear examples.

  • @hitk002cloudfull8
    @hitk002cloudfull8 3 ปีที่แล้ว

    you can also use prog1 &> file.txt
    to redirect both stdout and stderr to file.txt

  • @DailyBeatings
    @DailyBeatings 4 ปีที่แล้ว +1

    Pipes and redirections are my favorite things about linux and *.nix in general.

  • @jumanjiwarlord
    @jumanjiwarlord 3 ปีที่แล้ว

    🤯 aaaaaahhhh! I’ve been “aware” of pipes and grep for a long time but never understood them... this helped.

  • @Codester145
    @Codester145 4 ปีที่แล้ว +1

    Great video, love the Linux and Python content!

  • @youssefelamrani7905
    @youssefelamrani7905 4 ปีที่แล้ว +4

    I'm a big fan amazing video thank you, can you please do a video about graph theory in python using the Dijkstra algorithms like how to define a graph in python etc .. much appreciated

  • @kamildobrowolski143
    @kamildobrowolski143 4 ปีที่แล้ว +2

    Hi Engineer Man - can you explain why the following piping doesn't print anything to the terminal? echo 'hello' | echo

    • @EngineerMan
      @EngineerMan  4 ปีที่แล้ว +6

      This doesn't work because echo isn't designed to read from stdin. It's function is take a string supplied as arguments and output it to stdout.

  • @DS-rd8ud
    @DS-rd8ud 4 ปีที่แล้ว

    Have you done a video on process substitution, here docs and here strings?
    On a sidenote, I just discovered your channel and this is really interesting stuff. Keep is going, man!

  • @petehinch3871
    @petehinch3871 4 ปีที่แล้ว

    Great tutorial as always. Thanks EngineerMan

  • @sasakanjuh7660
    @sasakanjuh7660 4 ปีที่แล้ว +1

    Hey EM, great video, as usual! I was hoping you will also touch on redirections with exec, I alway had a difficult time wrapping my head around that, for some reason :D

  • @robc3129
    @robc3129 4 ปีที่แล้ว

    Really informative and to-the-point video. Well explained too.

  • @urugulu1656
    @urugulu1656 4 ปีที่แล้ว +1

    but can i use named pipes to send the output of a command to two programs at the same time?

  • @brainplot
    @brainplot 4 ปีที่แล้ว +2

    Great video as always! I have a question though. Why would I use named pipes over anonymous pipes? Do they offer any convenience or are they useful in particular and rare occasions where anonymous pipes cannot be used? Asking because although I knew about their existence I've never had a chance to use them :)

    • @gbuwally6326
      @gbuwally6326 4 ปีที่แล้ว +5

      Gianluca Recchia .signature was a common use of named pipes back in the day. An email program would take the content of ~/.signature and append it to the bottom of new emails. But say you wanted a random quote added to each new email? NAMED PIPES FIX THIS. You can write a program that takes a random quote and fits it into a signature block and then have it feed to a named pipe you happen to name ~/.signature. Now each new email has a fancy random snippet.

  • @RichardGreco
    @RichardGreco 3 ปีที่แล้ว

    How did you select only the carets in the text file when you added the additional caret at the end of the video? Great video!

  • @hobartspitz1029
    @hobartspitz1029 3 ปีที่แล้ว

    Great video. Could you explain why commands with large files and many filters (> 10) bog down? In my case, the filters don't reduce the number of characters flowing thru the pipes. Is this because of how the filters are dispatched? How large are the intra-filter buffers? When I do the same thing on CMS/TSO Pipelines, it's hundreds or thousands of times faster. And it doesn't matter if I have 100s or 1000s of stages. What gives?

  • @electricow1
    @electricow1 4 ปีที่แล้ว

    Is it true that piping a command to another is sometimes takes time to process, just like piping a watch command and awk it to filter the output, which is literally takes seconds to display. I found this case when i tried to make a monitoring script for my network devices by using fping to each of the hosts,

  • @linux_in_urdu486
    @linux_in_urdu486 4 ปีที่แล้ว

    You are legend mate, thank you for such a great video content!!!

  • @SeamusHarper1234
    @SeamusHarper1234 4 ปีที่แล้ว

    Really nice. Something made "klick" this time in my head.

  • @tobortine
    @tobortine 4 ปีที่แล้ว +1

    Why do you use the shebang "/usr/bin/env bash" rather than "/bin/bash" ? _(I'm genuinely interested to know if there's some advantage)_

  • @IND_Abhi
    @IND_Abhi 4 ปีที่แล้ว +4

    how are your 128 cores performing i wonder it might have finished cinebench is 1 sec

  • @ehcaning
    @ehcaning 4 ปีที่แล้ว

    That was perfect. Thanks for this great content!

  • @oyaraouf
    @oyaraouf 4 ปีที่แล้ว

    That was super helpful. Thank you so much.

  • @marcello4258
    @marcello4258 3 ปีที่แล้ว

    Are you sure > is truncating instead of just making a new file and changing the link to the file?

  • @cubodebits7721
    @cubodebits7721 4 ปีที่แล้ว

    Hi E-Man!!
    I think it would be very interesting talking about centralised authentication/authentication solutions. SAML, Kerberos, etc

  • @MaartenVanDamme81
    @MaartenVanDamme81 4 ปีที่แล้ว

    great refresher, thank you sir.

  • @MrApplewine
    @MrApplewine 4 หลายเดือนก่อน

    What does "&1>&1" or "&2>&1" do?

  • @eritert
    @eritert 4 ปีที่แล้ว +2

    I wish this was the first video on linux i watched

    • @SeamusHarper1234
      @SeamusHarper1234 4 ปีที่แล้ว +1

      You probably would have been like: "What the hell is he talking about, i'll look for another vid that teaches me how to change the folder i'm in."

    • @eritert
      @eritert 4 ปีที่แล้ว +1

      SeamusHarper1234 hahaha probably true

  • @kickflipz
    @kickflipz 3 ปีที่แล้ว

    Great reference video

  • @Javier-ue5nt
    @Javier-ue5nt ปีที่แล้ว

    very good video, keep it up :)

  • @MrApplewine
    @MrApplewine 4 หลายเดือนก่อน

    I don't see how "cat" is uncessary for a text file. Maybe you meant using redirect was better.

  • @N0thingFR89
    @N0thingFR89 4 ปีที่แล้ว

    and again :
    echo "You're the boss" > brian.engineerMan

  • @ElliyahuRosha
    @ElliyahuRosha 4 ปีที่แล้ว

    Great explanation

  • @johnm8358
    @johnm8358 3 ปีที่แล้ว

    clear 2&>1 concise!

  • @jeanhirata1485
    @jeanhirata1485 4 ปีที่แล้ว

    Really usefull thank u very much

  • @dawid_dahl
    @dawid_dahl 4 ปีที่แล้ว

    Thanks a lot!

  • @harrisonhu-d3z
    @harrisonhu-d3z ปีที่แล้ว

    good shares

  • @MsSoroar
    @MsSoroar 2 ปีที่แล้ว

    Fantastic

  • @n3r0z3r0
    @n3r0z3r0 4 ปีที่แล้ว

    More !!!!! :)

  • @jameshibbs6506
    @jameshibbs6506 4 ปีที่แล้ว

    Code Link give a 404

    • @EngineerMan
      @EngineerMan  4 ปีที่แล้ว

      Sorry about that, please try again.

  • @ashantharindu8915
    @ashantharindu8915 4 ปีที่แล้ว

    Hey, the lessons are great. Can you please speak a bit slower?