So first you set to delete the fifth line of the value users that you created in lesson five in lesson six lab.
So let's do cat on users and there we can see that this is
the line that we are going to Delete. So set -i5d on users and
now showing it again. And as you can see the swift line is gone.
Second part was to use awk in a pipe to filter the first column out of the results of
the command psaox. So this is psaox and we need awk. So I would use AWK print $1.
AWK is pretty good at finding a field separator that is based on spaces and depths.
And as you can see that is working pret.
Next we use grep to show names of all files in etc that have lines starting with the text root.
That would be grep l because we need the names
of vals and not specifically the contents in etc.
And we are looking for what? Well, let's do the
regular expression before the where we want to search.
We are looking for lines that are starting with root and maybe we want to make that case insensitive as well.
And oh boy, that's a lot of errors and so on.
So sudo grab il and why wouldn't we make that recursive as well?
There I need to enter my sudo password again. And here we have all of these files.
Then use grep to show all lines in the file users that contain three letters N.
You know what I would go for? I would go for grep nnn in users.
Doesn't have to be much harder than that.
Is that correct? If I don't see a result, then I
want to make sure that we are doing the right thing.
Well, the right thing kind of depends on how you want to do it.
Maybe we should interpret it in a different way.
Like this for instance. And then we have a match.
That's how we can interpret it as well. Right?
All lines in the values that contain three letters n. Nothing states that there
can't be anything in between the letters n. So the dot star that I've
inserted in the pattern is for zero or more characters between the n's.
And then the last one, find all lines ending with well, that should
be text $in users. And there we can see all lines ending with
the text Anna. And that's it. Let's move on to the next lesson.