In Lennox, nearly everything you deal with directly is a file.
So and most often these will be text files, for instance, our configuration files.
Um, in Lennox are text file senior.
And so to reconfigure an application, you simply open the configuration file, change the text and
save the file and then restart the application.
So your reconfiguration is complete here.
So now, with so many text files, manipulating text becomes circular in managing Linux and Linux applications.
So in this lecture, actually in this field a several lectures here, you will use several common commands
and techniques for manipulating text in Linux.
For illustrative purposes, I will use files from the world's best network institution detection system
and D.
S Snored, which was first developed by Martin Rules, and it's now owned by Cisco.
So NYDFS are commonly used to detect intrusions by hackers.
So if you want to be a successful hacker, you must be familiar with.
Our ways in I.T. is can um, detect detect attacks and the ways can abuse them to avoid detection.
So let's now I will, uh, learn about, uh, you learn you, uh, the beeping fire.
So, uh, the most basic text this will air command is probably kept here.
So Cat is, uh, to let's use cats to, uh, display this not config file from snort dot con fear,
as you can see here.
So let's in order to open up this file that's right here, cats slash eight CC small snore.
Start Quan Quan, OK.
Actually.
Actually, let's show and them bitcoin for cash.
So you can see this.
Now we printed our this file here, so, um, news can and should be like this here.
So in the following two elections, I will show you an election and next, uh, the next, uh, lecture
to I will show you to hear the detail and heat until, uh, comments, which are two methods for displaying
just part of the finest content in order to, uh, more easily with the key content.
So let's uh, right here.
Heat here.
Uh, it is the SNP s and P that can trigger action here.
As you can see now we are simply looking at heat here and.
Uh, we have.
So now if you.
And I just want to view the beginning of the file here.
You can use the heat command as I used it here, but by default is common.
This is the first ten lines of a fire, so one two three four five six seven eight nine 10 here.
So the, uh, command, for instance.
Uh, here.
For example, just if you want to see the first five lines here, uh, just minus finds the five here.
And then write your file here.
So note in my case is not here, but you can do it in file.
Actually, it's not.
And.
Actually, not as intense as an MP.
As an MP, that can as you can see here, we pour into the first five lines here one two three four
five.
So you should look like that, you see and the article like that, if you if I know right here eight
lines of actual.
Here it lines.
Here.
Oops!
It's an excellent yes.
Hate crimes, for example, as you can see here, I printed eight lines of our.
Configuration file here and here.
I'm sorry.
Let's change this resolution here.
A resolution here.
Yes.
This configuration here.
So.
Notice here we have.
Tatel.
Uh, come on the spill tail, commander spill here.
So the tail command is similar to the hit command.
But.
But it's used to weave the last lines of a file.
So let's use this tail comb one this well here again.
Uh, here.
Tell.
Here it is.
It's an empire, it's MP that configuration here.
Uh, but uh, so for example, it's as you can see, we're, uh, printed.
These are all files here because we don't mentioned any, um, any.
Last lions here, for example, if they try like that, for example, uh, minus five, this tail command
will show us the last file of last five lines of our, uh, configuration file or any text file here.
So, uh, we have then numbering the lines call months as well.
So sometimes, especially with very long files, we may want the file to display line or line numbers
signs.
This is an empty configuration, has not many lines here.
I will try another file here.
For example, it's found in the file um, file, for example.
Let's use.
Somebody here, some.
And SMB dot com, I think this moment, OK?
As you can see, there is a swarming alliance, so.
Mm hmm.
We may want to file display and nine line numbers because it's so many lines here with some configuration
file here.
So let's.
So this makes it easier to arrest and change and come back to the same place within the file, so to
display a file with nine numbers.
We chose the NFL, yes and l, uh, comments or simply enter the A comment here, et cetera.
It is here.
Um uh, what it was.
It was humble, right?
Yes, Samba Samba SMB configuration.
Uh, Samba SMB.
Com Fair, as you can see here, we printed a line like that.
Uh, line last line is one hundred eight and nine line here.
And as you can see here, we have so many lines here.
Yes.
So let's filter our files with.
Com month here.
So the command and grip is probably the most widely used takes manipulation command, so it lets you
filter the content of a file for display.
If, for instance, you want to see all lines that include word, for example, read on here or parts
here.
Uh, like that path here.
Um.
Uh, in your, uh, this SMB file configuration file, you called use camp and asked to display only
to files like that, for example, cat ethicists, some with some assembly that configuration and one
line pipe here and then grab, uh, grippier read uh, what it was.
Uh, read only use it.
Only read.
As you can see here, we printed out all our red files here.
So this command will first be, um, assembly configuration file and then using the pipe here to send
it to grab, and which we will take the file as an input.
So now look for license plate occurrences of the word read.
And display only to lions here, as you can see here.
So the grape command is very powerful and essential command for working in Linux because it can save
you hearts of searching for every occurrence of a volt or command in file.
So.
Well, let's say you want to display the fine lines immediately before a line that says Step six to
configure polygons using the LEDs for comment you just earned.
So how have you how will you do it?
So.
And.
So there are many options to this commander to, as we have discussed, so you can learn more commands
by using the built in Linux men, for example, mentale here will show the health file of tail comb
mounted as you can see here, or, uh, just press X and then enter to quit here.
Yeah.
Uh, our uh, you can press Q Command to create here.
What example, man can't, as you can see here, we're showing, uh, health file of cat combattere
or non amputee.
So a man is, uh, helpful comment here.
Uh, actually actually, it's application here, so it will help you to show the health files of, uh,
your.
Application of common.
So there are many ways to solve this challenge, and he and I show you each line stretching to do it
in one way and your find another method here so we can do it like that and how it is there some bar
assembly that can fish and pipe here and grip right here.
As you can see here, we bring that this here which so we can see that the line here in the.
We pretend like that here, as you can see, or with lines.
No.
So as you can see here, we have, um, challenges done with Intel and grab command.
As you can see here we have um, we used nail command, which is similar to Cat, but it solves the
lines of numbers or in one hundred eighty two, uh, line we have read only yes, one hundred seventy
four.
We have read only here, as you can see here.
So I will of, uh, video here and I'm waiting.
Go in next picture.