[Autogenerated] Hello and a really big warm welcome to
you to this plurals site presentation, Linux administration with sd and org.
In this course, I'm going to be your instructor and ID like to introduce myself.
Hello, I'm andrew Mallet.
How are you?
We are going to have a great time as we go through
all of the modules in this module,
introduction to regular expression and filtering text.
We're not only going to introduce to you the complete course,
but we're going to be taking a look at some of the tools that we can use and
beginning to get used to some of the basic tools that's going to allow you
to unlock the power of the Linux command line.
And this is really important that you're able to manipulate text files and
you're going to see that we can do this with sd an arc.
But we'll also be taking a look at some of the other tools that we've got
such as re app and how we can start dealing with our different types of
file formats such as CS V files and space,
delimited files.
As we look through this module,
we're going to be taking our peek at the complete course content we're
going to be using some of the tools such as RES and AC we'll be looking at
mastering said really becoming a master of being able to use the stream
editor as well as working with arc arc is a really powerful text reporting
tool that we can use to extract the data and present it the way we really
need it with arc.
We'll be looking at working with YAML an XML data and how we
can present an extract data from those file formats as well as
extracting data from log files.
In this particular module,
we're going to be concentrating on getting used to regular expressions and
we can do that using the command line utility re app.
Along with that,
we're going to be working with some very simple text file formats.
So we can start looking at our, our comma separated files,
our ordinary space separated files as well as looking at
things like our E T C plus W T file, which of course is colon separated.
Now, what are these tools that we are going to be discovering?
Great question.
Shall we take a look?
Well, first off, we're going to be taking a look at re app.
So this allows us to search and filter lines within a text file.
We can look at it as horizontal filter because we're only showing certain
lines and self if it helps stands for globally searching with a regular
expression and printing the results next up,
we'll be looking at the stream editor set,
the stream editor allows us to programmatically edit files.
This is really important because we can then edit files through scripts
and we can also edit files across many different systems without having
really to get the interactive command line.
So this can be really important to you.
And then finally, we're going to be taking a look at org.
This is a very powerful text reporting tool.
So it's similar to re ping that we're searching for data,
but we can create reports based on the data that we pull back and its
name if that helps you understand it a little bit more.
And named after the surnames of the people that developed its are Alfred Aho
Peter Weinberger and Brian Kern to be able to really learn,
you're going to need the lab environment,
but we shouldn't need to set too much up here.
We just need a single Linux system available to us.
The distribution itself is not so important.
The tools are going to be very similar across all Linux distributions.
You can choose what you'll be using.
This could be a virtual machine, it could be a machine that you're hosting.
It could be a virtual machine in the cloud git, Digital Ocean or AWS.
But for me, I'm using my Raspberry Pie that's running the operating system.
Sian Buster 10.
Now say first up, we're going to be getting to know re app.
When we take a look at re app, we can run it from our command line.
And if we look, let's say for root from our E T C password file,
we're looking for the string route.
Now,
this might come back with a single line or it might
come back with multiple lines.
We're not looking for the word route.
It is the string route.
If we want to look for root at the beginning of the line,
we can put a meta character in here,
we're using the upper case six or the Carrot symbol with this.
We're then saying the line must begin with the root.
We're still not looking for a single word because we
haven't put anything after the T.
So it could be both the root account as well as the root ball account,
let's say.
But so long as the string starts with the root,
similarly, as we can search for the beginning of the line,
we can look for the end of the line.
The meta character that we use for the end of the line is the dollar symbol.
Here, we're looking for lines that end with bash for us.
This is going to show those accounts that have bash as the default shell.
We could also count the number of matches rather than printing them.
So using the option minus C, we're able to easily count the number of options.
Now, we probably don't have that many entries in our E T C pass W D file.
So it won't really seem that significant.
But imagine a much larger file where the entries are
much more difficult to count here.
If we look at our E T C services file that have all of our
services and protocols supported within it,
we can count all of those application services that sit
upon the transport protocol TCP by literally looking for
the string forward slash TCP.
Using the option minus C again,
we can quickly and very quickly count up all of these entries.
Now,
this gives you a good introduction both to the re pool
as well as to regular expressions.
But there is a lot more to discover.
But let's first of all,
make sure that we can get some of these simple regular expressions
under our belt by moving out to our command line where your
learning journey really is going to begin.