Let's continue with our penetration testing, a Central Command line skills.
The first to tell is that we will talk about today is OK and cut.
They all can cut or commonly use when filtering outputs from your comments or sometimes from files.
Let's take an example on the cut, come in and see how we filter the output that we will get from a
file.
Let's take a look at our IP is that text file.
As we can see, this file has two parts separated by a space, the first part is the user name and the
second part is the IP.
We want to use the cut, come in, just put each line into two parts, the username part and the IP
part, we can use the best argument which specifies that the limiter.
So if you want to put the lines into two parts with this piece as a delimiter, we can use a Dashty
and then double quotes and then space between them.
Let's try we will cap the IP is that text and use its output as input to the cut command.
Notice that I didn't like our command.
It mandates us to specify a field.
We can use that by adding the dash F and the number of the field we want to print.
The first part of the line on the left side will be field number one, and the second part on the right
will be field number two.
Let's write
nice.
Now, what if we want to further filter the output to show only the names without the user name part?
We still can pass this output to another cut command, but this time we will use the colon as our delimiter
and prenda second field.
Nice.
Now, let's see if we can accomplish the same thing using the ARC utility, the ARC utility is a little
different than the cut command.
It has a default delimiter, which is the space.
So we don't have to specify that if we know that our delimiter is a space.
But in order for us to manually specify the limiter, we use the Desh Uppercase F.
After we specify our delimiter, we need to specify which field to print using the print statement and
the dollar sign followed by the field number.
Let's try.
Nice.
Now, let's further filter the output to show only the name part.
Now we are done with the all clear cut comments, let's switch to something else.
We will now talk about how to manage our processes and Kawi leanings.
Let's first start the process.
Simple Pinkham and.
In order to run this command in the background, we can first redirect its output to a file and add
ampersand to the end of the command.
Let's try.
Now, let's check the output file and see if the process is really running in the background and writing
its output to our file,
it looks like our process is running.
Now, let's bring our process to the foreground and stop it using the control policy in our keyboard.
But first, let's see what's our process number by typing jobs in the command line.
As we can see, we have only one job and it has a number one.
Let's bring it to the foreground by typing f g space percent, followed by the job number.
Now, let's start the process with the control policy.
Nice.
We can also use the control plus Z to suspend the process and put it in the background, hilarious.
Let's try that.
Now, let's start with the man with the control policy, the process running in the background with
the kill command, but first let's run the process and examine its ID using the command.
There are a lot of processes running in the background, let's filter them using the crêpe told me and
look for our Pinkham and.
Notice, the second column is for our society, let's copy that I.D. number so we can use it with our
comment.
Now, let's say she came in again and see if the process is still running.
As you can see from the output, the process has been terminated.
We have reached the end of this lesson.
Thank you and see you in the next one.