What is stdout, stderr, /dev/null and redirection? | #4 Practical Bash

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • Surely you've heard other talk about stderr or "Standard Error". Similarly there is "stdout" or "Standard Out". But what do they mean. What are those numbers and what is redirection? Ever heard of /dev/null? This video is all about the different output streams in bash and how you can manipulate them to your advantage

КОМЕНТАРІ • 27

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

    How did I not stumble into your channel years ago is beyond me. Amazingly explained!!

  • @momo-dm3rw
    @momo-dm3rw 4 роки тому +1

    That terminal emulator palette is beautiful. Powerlevel makes it extra sophisticated.

    • @kubucation
      @kubucation  4 роки тому +2

      Thanks it’s „Solarized“ in case you were wondering. Should be available for all common terminal emulators.

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

    Great and simple as always :)

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

    Explanation was superb! Thank you so much :)

  • @Mado44555
    @Mado44555 6 місяців тому

    man that s a diamond explanation

  • @lilbob1463
    @lilbob1463 4 роки тому +2

    Why is echo "the current version of foo is $(get_latest_version 2>&1 1>/dev/null)" print out "Resolving Host" etc instead of nothing? Isn't that they are redirected to stderr inside the function by 1>&2 and then they are redirected to stdout and discarded by 2>&1 1>/dev/null? or I am getting the order wrong here? Thanks

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

      I think the commands are running one by one in command substitution so during the redirect 2>&1 the output is redirected and printed and then the next command runs which is whatever is left in stdout is to be discarded.

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

    I really liked your theme. Can you make a video about it?

  • @beaupersoon5221
    @beaupersoon5221 4 роки тому +5

    when you say /dev/null at 3:09 you sound like Gru from despicable me

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

    great teaching!

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

    Great videos! Thank for making these, are you on Twitter?

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

      Thanks! So far only with my personal account (@etiennedi), but if this channel keeps growing I might also add one for kubucation ;-)

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

    Hi, why does the echo command of your script (that outputs the function) isn’t the first thing echoed to screen even if functions body redirects to stream 2?

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

    Hi. Why redirecting 2>&1 if stream 2 is echoed on the screen anyway?

  • @grim.reaper
    @grim.reaper 5 років тому +2

    Can you please link to your vim/powerline/bash configs, they look pretty neat 🤩

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

      Thanks! Sure you can find them all in here: github.com/etiennedi/dotfiles

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

      looks amazing

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

    Tx. Leveled up :)

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

    i think this video should've come after you explained curl

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

      Fair point, curl will come soon!

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

    0:50 an Indian scammer writing a windoz wirus

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

    dislike for light theme in editor

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

      Upvote for very strong feelings about color themes

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

      @@kubucation That made my day.

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

      @@kubucation lmao