Save this video free

Lecture 6: Redirections; Pipelines; tee; Expansions

Burton Ma · 48:51 · Watch on YouTube

Lecture 6: Redirections; Pipelines; tee; Expansions Watch on YouTube →

Overview

Burton Ma explains how Bash connects standard input, standard output, and standard error to files or other commands, then demonstrates pipelines, `tee`, and text-processing tools such as `sort`, `uniq`, `wc`, `less`, and `cut`. He then introduces Bash tokenization and expansion, emphasizing that brace expansion, word splitting, and filename expansion are distinct processes with different roles.

Key takeaways

Chapters

0:00 Redirecting Bash Standard Output and Standard Error
5:00 Reading Files Through Standard Input with `<`
9:00 Connecting Commands with Bash Pipelines
15:00 Combining `sort`, `uniq`, and `wc` in Pipelines
20:30 Pipeline Execution and the `tee` Command
26:00 Extracting Fields with `cut` and Reusing `tee`
32:30 Bash Tokenization and the Expansion Pipeline
38:00 Generating Strings with Bash Brace Expansion
45:00 Using Brace Sequences for Year-Month Names

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:11 All right, good afternoon everybody. So, uh picking up where we left off uh from the previous lecture. So in the previous lecture we were talking about streams um and I was showing you how to redirect um I was showing you how to redirect output from a command to a file right so remember most commands if they generate output they will send the output to standard out which by default is connected to your terminal right if you want to redirect the contents of the if you want to redirect the output to a file instead uh you can use the greater than operator right? And uh redirect the output of the command uh to a file. So in this case uh this uses the cows command to print some text well to

1:00 generate some text which would normally go to standard output but instead we're going to send it to the file moo.ext. And if you try out that command right so now if you run this command it generates no output to the terminal. Why? Because all the output has gone to moo.ext. Right? If you look inside moo.ext, you'll see uh the output of the cows command. Okay? And also remember I showed you this a couple lectures ago. If you when you redirect to a file, it overwrites an existing file. If you want to add to the end of an existing file instead, use greater than greater than. And that will append the output to the end of the file instead of overwriting the existing

1:49 file. Right. Okay. Now, there are occasions where you will want to redirect standard error as well. Right? So, it's often the case you don't want to redirect standard error. If you get an error message, you want to

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Burton Ma.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.