Ask Question
2 November, 04:23

Which of the following is not a command for determining if MySQL is running on Linux (Ubuntu) ?

(a) sudo service mysql status

(b) ps - ef | grep 'mysql'

(c) sudo check status mysql

(d) sudo systemctl status mysql

Answers (1)
  1. 2 November, 06:07
    (c) sudo check status mysql


    The commands service, ps and systemctl, are different ways to find out if MySQL is running on Linux (Ubuntu), but there is not such a command called check to do so in Linux.

    Different programs in Linux operating system are organized in processes, and they are all created for a specific purpose: running an application, starting a web browser, and so on.

    Some other programs like the init program start and stop essential service processes and there are currently two major implementations in Linux distributions:

    System V init (traditional implementation) systemd (emerging standard for init).

    The commands service and systemctl are related to System V init and systemd, 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: sudo service mysql status.

    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: systemctl status mysql).

    The command ps (process status) "displays information about a selection of the active processes" [ps 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 piped to grep (global regular expression print) command to find those processes mainly related to 'mysql'.

    It is important to remember that command sudo (superuser do) permits a user to "execute a command as the superuser or another user" [sudo man page], since commands service and systemctl require privileges to be run, for security reasons.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Which of the following is not a command for determining if MySQL is running on Linux (Ubuntu) ? (a) sudo service mysql status (b) ps - ef | ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers