Getting
Started with the Basics
13
example, suppose I want to see all the processes running on my Linux sys-
tem. In this case, I can use the
ps
(processes) command followed by the
aux
switches to specify which
process information to display, like so:
kali >
ps aux
This provides me with a listing of
all the processes running in this
system—but what if I just want to find one process to see if it is running?
I can do this by piping the output from
ps
to
grep
and searching for a
keyword.
For instance, to find out whether the apache2 service is running,
I would enter the following.
kali >
ps aux | grep apache2
root 4851 0.2 0.7 37548 7668 ? Ss 10:14 0:00 /usr/sbin/apache2 -k start
root 4906 0.0 0.4 37572 4228 ? S 10:14 0:00 /usr/sbin/apache2 -k start
root 4910 0.0 0.4 37572 4228 ? Ss 10:14 0:00 /usr/sbin/apache2 -k start
--
snip--
This command tells Linux to display all
my services and then send
that output to
grep
, which will look through the output for the keyword
apache2 and then display only the relevant output, thus saving me consid-
erable time and my eyesight.