So first question was to use head and tail
to display the fifth line of the file ETC pass WD.
I would say head minus 5 ETC pass WD pipe tail minus 1.
And there we have the fifth line.
Now we need set to do the exact same thing.
Well, there it will be set minus N5P on ETC pass WD.
And here we can see one of the things
that you frequently see on Linux.
Different commands can be used to get to the same results.
And in the end, it's up to you what you want to use.
Then we need to use org in a pipe
to filter the last column out of the results of the command
PSAOX.
So PSAOX pipe org.
And then we are going to do a print.
Well, org is pretty good at printing fields.
And we are using $NF.
And $NF is for the last column.
And here we can see what this last column is looking like.
Now sometimes that doesn't make sense.
But hey, we didn't ask for anything that makes sense.
We just asked for the last column in the output.
Next, we need to use grep to show
the names of all files in ETC that
have lines that contain the text root as a word.
So grep minus L, because we want to see names of files.
And there we are looking for a root in star.
And oops, I'm doing that in the wrong directory,
slash ETC star.
And there we have the result. In the result,
you can also see there are a lot of is a directory messages.
These are considered error messages.
And if you don't want to see them,
use to great then slash dev slash null to skip all of these.
Then we need to use grep to show all lines from all files in ETC
that contain exactly three characters.
So this time, we can almost keep the commands.
But we need to change the regular expression
to start with the caret.
And then we have three dots for exactly three characters.
And then we have a dollar.
And there we can see the result of these files.
And finally, we need to use grep to find all files that
contain the string Alex, but make sure that Alexander is not
included in the result. Hey, didn't we
create a file with the name users?
Yeah, there we go.
And grep Alex slash B on users.
That is what we need here.
So slash B makes it a word and makes
that Alexander, in this case, is not a match.
And that is what we had in mind for this lab.