WEBVTT

00:00.550 --> 00:01.990
Hello, my name is Typhoon.

00:01.990 --> 00:07.750
And in this lecture of our course, you will learn about lot of things about Linux command line.

00:07.750 --> 00:09.070
So let's get started.

00:22.400 --> 00:28.790
When you work in the Windows, Mac OS and most other operating systems, you probably spend your time

00:28.790 --> 00:34.490
running applications like web browsers, word processors, spreadsheets and games.

00:34.520 --> 00:41.730
A typical application is packed with features everything that designers or their users will need.

00:41.750 --> 00:44.360
So most applications are self-sufficient.

00:44.630 --> 00:53.330
They don't rely on other applications, so you might copy and paste between applications from time to

00:53.330 --> 00:56.660
time, but for the most part they are separate.

00:56.780 --> 01:01.130
But the Linux command line is different.

01:01.160 --> 01:07.640
Instead of big applications with tons of features, Linux supplies thousands of small commands with

01:07.640 --> 01:08.960
very few features.

01:08.990 --> 01:11.150
The command cat, for example.

01:11.150 --> 01:15.500
Cat the for example, the print files on the screen.

01:15.500 --> 01:16.220
That's about it.

01:16.220 --> 01:23.840
So the less files, less here, less command lists, the file in a directory, MV renames files and

01:23.840 --> 01:24.320
so on.

01:24.320 --> 01:28.580
So each command has a simple, fairly well-defined purpose.

01:28.610 --> 01:30.990
What if you need to do something more complicated?

01:31.010 --> 01:31.550
Don't worry.

01:31.700 --> 01:40.400
So Linux makes it easy to combine commands so their individual features work together as accomplish

01:40.400 --> 01:40.930
your goal.

01:40.940 --> 01:45.740
So this way of working yields a very different mindset about computing.

01:45.770 --> 01:52.790
Instead of asking which application should I launch to achieve some results, the question becomes which

01:52.790 --> 01:55.940
command should I combine?

01:56.120 --> 02:02.300
In this lecture, you will learn about how to arrange and run commands in different combinations.

02:02.300 --> 02:05.420
To do what you need to keep things simple.

02:05.420 --> 02:13.070
I will introduce just six Linux commands and their most basic uses so you can focus on the more complex

02:13.070 --> 02:18.680
and interesting part about that, combining them with a huge learning curve.

02:18.710 --> 02:26.640
So it's a bit like learning to cook with six ingredients or learning carpentry with just a hammer and

02:26.640 --> 02:26.960
saw.

02:26.970 --> 02:31.050
So you will combine commands using pipes.

02:31.380 --> 02:34.230
And here this is a pipe here in Linux.

02:34.230 --> 02:42.840
So this is the Linux feature that connects the output of one command to the output of another.

02:42.840 --> 02:46.290
So let me open my driver here.

02:46.320 --> 02:49.500
Jiffy Yeah, Grommet NP here.

02:49.500 --> 02:50.250
So.

02:51.170 --> 02:52.790
It takes one here.

02:52.790 --> 02:55.030
So if you have here.

02:55.040 --> 02:55.450
Yeah.

02:55.460 --> 02:56.240
Toggle painting.

02:56.240 --> 02:56.770
Yeah.

02:56.780 --> 02:59.480
If you have one here, for example, this is our one result.

02:59.480 --> 03:04.850
If you make pipe between them like this, this will take here and put it here.

03:05.390 --> 03:06.350
So.

03:07.690 --> 03:10.390
We will example will be practical for daily use.

03:10.390 --> 03:16.300
So while others are just toy examples to demonstrate an important feature.

03:16.390 --> 03:22.900
So let's get started with input output and pipes in Linux here.

03:23.260 --> 03:24.550
Uh, yes, actually.

03:24.550 --> 03:27.660
How can we clear screen shift and home?

03:27.670 --> 03:29.440
Yes, clear screen here.

03:29.470 --> 03:34.360
So most linux commands read input from keyboard.

03:35.360 --> 03:37.950
Write output to the screen or both.

03:37.970 --> 03:41.330
So Linux has fancy names for the reading and writing.

03:41.330 --> 03:42.410
For example.

03:42.800 --> 03:43.760
STD in.

03:43.880 --> 03:45.560
STD in here.

03:45.560 --> 03:47.810
So this is actually not a comment, but just I want to talk.

03:47.870 --> 03:48.740
About this.

03:48.740 --> 03:54.500
So this STD in is standard input or standard in so this is a stream.

03:54.530 --> 03:58.970
Of input that Linux reads from your keyboard.

03:58.970 --> 04:05.750
So when you type any comments at the prompt, you are displaying data on STD in.

04:05.840 --> 04:12.920
And we also have the STD out pronounced as the standard output or standard out.

04:12.950 --> 04:16.970
So this is the stream of the output that Linux writes to your display.

04:16.970 --> 04:25.010
So when you run the command, for example, to print file names, the result appears on STD out.

04:25.010 --> 04:33.170
So now this comes the cool part here so you can connect the STD out of one command to the STD in of

04:33.170 --> 04:33.650
another.

04:33.750 --> 04:35.790
So the first command feeds the second.

04:35.790 --> 04:39.870
So let's begin with the familiar LSL command here.

04:39.870 --> 04:43.140
So LSL and been here, for example.

04:43.590 --> 04:48.900
So as you can see here, the directory contains far more files.

04:48.900 --> 04:54.240
For example, if you have directory contains the file more files than your display has lines.

04:54.240 --> 04:58.110
So the output quickly scrolls off the screen here.

04:58.110 --> 05:04.720
As you can see, it's a it's a shame that the LHS can't print the information on screen and full at

05:04.720 --> 05:05.130
the time.

05:05.130 --> 05:13.860
So pausing until you press a key to continue here so like this or for example, s m home oops, home.

05:13.860 --> 05:16.710
And as you can see here, we got this.

05:16.830 --> 05:17.700
So.

05:19.300 --> 05:27.670
Asexual also used a less here for example my file and as you can see we don't have a my file so the

05:27.670 --> 05:34.420
last command displays a file on a screenful at a time so you can connect this to your commands because

05:34.810 --> 05:39.160
writes the stdout and less can read from the stdin.

05:39.160 --> 05:42.970
So for example ls ls l here?

05:42.970 --> 05:44.500
So let's clear?

05:44.530 --> 05:45.220
Yeah.

05:45.430 --> 05:53.580
LS l here bin And this is a pipe here, so use a pipe to send the output from L.

05:53.590 --> 05:55.840
S to bin here.

05:55.840 --> 05:57.610
So not like this here.

05:57.610 --> 06:05.530
So use a pipe to send output from ls to the input of less here.

06:05.530 --> 06:08.770
So in this case the less is going to be less.

06:08.770 --> 06:10.360
And just add.

06:10.360 --> 06:15.460
And as you can see here, we got an a screen here like this oops.

06:15.610 --> 06:16.230
Here.

06:16.480 --> 06:16.930
So it.

06:16.930 --> 06:17.500
Yeah.

06:19.820 --> 06:20.180
Here.

06:21.130 --> 06:22.150
As you can see here.

06:22.150 --> 06:27.250
So the combined command displays the directory contents one screenful at a time here.

06:27.250 --> 06:28.630
So the vertical.

06:29.460 --> 06:33.810
But here vertical path that we've written here.

06:35.570 --> 06:36.400
Yes.

06:36.410 --> 06:40.220
Uh, here, press return to quick here.

06:40.220 --> 06:44.690
Or for example, let's lsl home like this.

06:44.690 --> 06:48.440
And as you can see here, we've written like the output here.

06:50.360 --> 06:50.990
Like this.

06:52.060 --> 06:55.360
So first commands is stdout to the next command.

06:55.750 --> 06:59.330
And so any command line containing pipe is called.

06:59.350 --> 07:00.250
Pipeline.

07:00.250 --> 07:03.610
So commands generally are not aware that they are part of a pipeline.

07:03.610 --> 07:11.530
So unless believes it's writing to the display when the expected output has been redirected to less

07:11.530 --> 07:17.410
here so and less believes it's reading from the keyboard when it's actually reading from the output

07:17.410 --> 07:19.150
of a less.
