Answer:
(c) sudo check status mysql
Explanation:
The commands service<em>, </em>ps<em> </em>and<em> </em>systemctl<em>, </em>are different ways to find out <em>if MySQL is running on Linux (Ubuntu), </em>but there is not such a command called <em>check</em> to do so in Linux.
Different programs in Linux operating system are organized in <em>processes</em>, and they are all created for a specific purpose: running an application, starting a web browser, and so on.
Some other programs like the <em>init program</em> start and stop essential service processes and there are currently two major implementations in Linux distributions:
- <em>System V init</em> (traditional implementation)
- <em>systemd</em> (emerging standard for <em>init</em>).
The commands service and systemctl are related to <em>System V init</em> and <em>systemd</em>, respectively, and can list the status of a program.
Thus, the command service can list if MySQL is running on Linux using the piece of code in the question: <em>sudo service mysql status</em>.
Likewise, the command systemctl can activate and deactivate services, and, among many other functionalities, list the status of a program (like the one in the question: <em>systemctl status mysql</em>).
The command ps (process status) "displays information about a selection of the active processes" [<em>ps</em> man page]. The command has many options, and some are -e (select all processes) and -f (full-format listing). In this case, the command output is <em>piped </em>to grep (global regular expression print) command to find those processes mainly related to 'mysql'.
It is important to remember that command <em>sudo</em> (superuser do) permits a user to "execute a command as the superuser or another user" [<em>sudo</em> man page], since commands <em>service</em> and <em>systemctl</em> require privileges to be run, for security reasons.