We have just talked about the sorting of the files in the output of Alaska amount.
And now you know how to sort files, for example, by file size in ascending or descending order.
Sought by modification date or how to sort by files extension?
No, let me explain.
And also due a cold sort.
And with this ability, you are able easily sort contents of specific files.
And first, let's create simple file.
And I'll agree that using Coonana Ed they are not and left school file animals don't dig deep.
And here, let's play some animal names to get a dog up.
Elephant.
Monarchism.
And let's say they are like, so let's save the file.
The control exit.
Yes.
And press enter.
And now this file should be present here in rocking directory for this user.
All right, let's exit.
And now let's use sort of tilted board to first to let me and or sort with option help.
And here, well, it's a scroll up and you'll see actually a description of what this will do.
It will sort concatenation of a file or files and result of the sorting will be printed to standout
output.
It means that the file itself will be modified.
But of course, there was an option that allows you to create the file and start there, a result of
sorting cooperation.
Here was this option desk.
Oh.
Also, using other options, you are able to sort the numbers, for example, or to apply rivalrous
sort.
All right.
Let's first try to sort the contours of animals, batiks, defile, sort animals, the tax deal.
And now I see that the old lines in these animals batiks defile way are sorted in alphabetical order.
First garms bureau.
Then the cat dog and so on.
Let's apply or over a certain sort.
Desh are like so and no.
I see that the alliance where I bring in rivalrous order.
Let's now say result of the sorting into the file using Desh or option.
And here will be a file sorted dot the extreme like so.
And now let's have a look at contours of sort of the text file.
And in this file I'll see the same result as they have seen here.
And of course, file any multiple D initial file remains here unchanged.
That's how it is possible to sort goondas of specific file.
But no, let's create the file that will contain some numbers.
Let's use again, narrow editorial numbers to door DST.
And here, let's add some numbers like so.
Some large number, small number, something girls like, so and let's save the file.
Yes.
And right.
Condon's.
All right.
Let's use again sort of command.
And the here will be nonbiased of the 60 file as argument.
And here I see a result of sorting.
And that's probably not what you have expected from.
So desperation applied to numbers.
And the reason for such a result is that sort of Bly's actually sorting do characters, not numbers
by default, but using desch and option.
Like this, you are able to apply certain numbers and note you see correctly sort of Lombroso starting
from smallest and and with the largest one.
And also same as with the strings, you are able to bring a result of this sort in into the file.
This all sorted.
The numbers dot the 60 and no, I see that sort of numbers.
But they do file was created here in working directory.
Let's have a look at the contents of this file.
And yes, here I see sort of the numbers starting from the smallest one.
Same result as here.
And notice that there was this option in place.
This all you simply sent is to the out data stream from sort of process, not to terminal.
It is default actually action, but instead to the file sort of Nomura's boutiques in this case.
But of course, you are always able to use such syntax, sort of this and Lombroso to dig deep here
will be greater than the sign that stands for redirection of the out specific file.
And here will be a file name.
And let's simply use file name, sort of dot the 60.
And the result will be actually the same card.
So that takes time.
And now I see here same contents as in an ARS or file sorted numbers.
Dodig still.
All right.
This is how you could sort numbers in the file altered as possible to leave only unique values.
Let me show you that.
Let me clear terminal end here.
Type, sort.
This does help.
And here will be a pipe grab, but unique like so.
And you see that using this you or that unique option.
You could leave only unique values in the resulting output.
Let's actually modify numbers.
The text file a bit.
Na'ama numbers about the 60.
And here, let's add the same number, 24 as bureaus here and here.
Let's add somewhere number two like this.
Let's save the file.
Yes.
And if I'll simply sought it without this option, like sort this end.
And here will be numbers in the text.
I'll see it two times two and two times twenty four.
But if I'll add the here additional option.
Desh, you like this.
I'll see that.
Do I bureaus.
Only once.
Same as 24.
Also you are able to additionally add here our other option if you want, but put salt in descending
order.
All right.
That's all what I wanted to tell you about the sort command.
It allows you to easily salt content of specific Deakes defiles.
And by default, this command print result by the out to terminal.
What of course, you are able to bring the result to some Özal file.
That's all for this lecture.
And the next one, I'll start talking about permissions of the files and creation of additional users.
Let's talk about it next.
My.