Linux Crash Course - Data Streams (stdin, stdout & stderr)

preview_player
Показать описание
In this episode of Linux Crash Course, we'll go over data streams. Specifically, Standard Output (stdout), Standard Input (stdin), and Standard Error (stderr). We'll also take a look at how to redirect specific data streams, so you can easily separate errors from output.

*🎓 CROWDSTRIKE CRASH SURVIVOR T-SHIRT*
Commemorate the largest outage in history with the latest addition to the LLTV merch shop.

*🎓 BRAND NEW UDEMY COURSES AVAILABLE!*
Check out my new courses on Udemy and learn something new!

*🐧 SUPPORT LINUX LEARNING!*
_Note: Royalties and/or commission is earned from each of the above links_

*⏰ TIME CODES*
00:00 - Intro
00:41 - Quick note regarding input/output
01:17 - The three data streams (standard input, standard output, and standard error)
03:06 - Example of Standard Error (stderr)
03:47 - Using the echo command to find the return code
05:54 - Example of both standard output and standard error from one command
07:47 - Splitting standard output and standard error
09:06 - Number designations for stdin, stdout, and stderr
10:24 - Sending stdout and stderr to different files*🎓 FULL LINUX COURSES FROM LEARN LINUX TV*

*🌐 LEARN LINUX TV ON THE WEB*

*⚠️ DISCLAIMER*
Learn Linux TV provides technical content that will hopefully be helpful to you and teach you something new. However, this content is provided without any warranty (expressed or implied). Learn Linux TV is not responsible for any damages that may arise from any use of this content. Always make sure you have written permission before working with any infrastructure and that you are compliant with all company rules, change control procedures, and local laws.
Рекомендации по теме
Комментарии
Автор

I've been using linux for years and never really understood this. Thank you so much!

clblanchard
Автор

And that's why I'm proud of myself...
I never think I know everything.
I'm a linux administrator as part of my day job and I think I got a good amount of experience with the command line but reading the title of the video made me think "Maybe I'll learn something new about stdout and stderr".
I wasn't wrong.

"find /etc -type f > ~/results.txt 2> ~/errors.txt"
Never knew or thought about splitting the streams.
THANK YOU FOR THAT!
So useful.

RayBitton
Автор

When I am introducing someone to the command line this is my go to example of where the command line interface still wins out over a graphical program. The beauty is the application(s) being used don't need to be changed in any way as it is the shell that handles it all for you (providing the applications output to stdout and stderr properly).

I once worked with someone that was very "ugh I hate the command line, it's not the 1980s anymore, GUI is always better" so I asked then to do just what you did. Output valid results to one file and errors to another. The only way he could do it was manually and by actually looking then copy/paste the errors to a separate file as none of his graphical tools could filter output (they would just save everything to a single file) so would require the application itself be updated to include such functionality.

It didn't totally win him over but it at least shut him up as he knew I would always bring that example up if he ever went on a "GUI is better" rant again 😂Truth is you use the right tool for the job, sometimes that *is* a GUI application but sometimes it's a CLI one so knowing how to best use the tools available is important.

Great video 👍

satysin
Автор

I'm here because of the bandit7 game from OverTheWire. I never thought learning Linux would be so interesting. Great video.

FigueMonk
Автор

Very nice explanation. Thank you for your teaching method in the simplest way.

yjjjgpz
Автор

I was expecting you to talk about how to output both stdout AND stderr to a file.
For anyone wondering we do it like this: find /etc -type f > combined.txt 2>&1

greob
Автор

This was incredibly clear. Thank you for the content!

hugog.cintra
Автор

You are teaching style is amazing brother ✨✨✨ one love from Tanzania, thanks for sharing, your tutorial are highly recommended to anyone interested with learning Linux.

piusvictor
Автор

Another awesome video Jay, you are a great teacher. I would love to see a beginners guide to regular expressions. Thanks!

sgt.chutney
Автор

YOUR EXPELTAION WAS SO CLEAR AND GOOD.WAS EASY TO UNDERSTAND !THANKS

itay
Автор

Nice and clear explain, thank you so much! :))

deedoi
Автор

Thank you! I needed clarification on this!

TheRexhim
Автор

You’re amazing Jay. Thank you for all of your videos. It’s really the best

polliluiz
Автор

You miss 2>&1 to redirect both output (stdout) and errors (stderr) to same file like find /etc/ -type f > ~/all_results.txt 2>&1

paulojsilva__
Автор

Love these vids that teach me some of the basics we keep forgetting well done and thank you

Andy.N-_-
Автор

Although I know most of what you're talking about, I enjoy watching the explanation

egysnet
Автор

Great vid as usual. Any chance of a video on bash special params: $*, $@, $#, $$, $!, $?, $-, $_ And how they are used?

devbites
Автор

Thank you very much for this wonderful lesson.

anthonyverzosa
Автор

Great tutorial again. Thank you! Your videos have helped me with work on a daily bases

tilla
Автор

Very good explanation, really very good teacher

jacekkieblesz