Issue
I am trying to obtain the status of a httpd service with Centos 7. I want to know if i can print only the value of Active, that in this example is inactive (dead)
This is the command that i am using:
[root@localhost ~]# service httpd status | grep Active
This is the result of that command.
Redirecting to /bin/systemctl status httpd.service
Active: inactive (dead)
This is the output that i a want: inactive (dead).
Solution
Maybe something like this:
/bin/systemctl status httpd.service | grep -o "\w*ctive "
Answered By - Picard Answer Checked By - Cary Denson (WPSolving Admin)