I'm trying to retrieve a list of multiple service statuses in Unix. I'm using the
service command: man page.
The statuses all start with the
transmission-daemon string, for example.
I require the ability to list multiple services' statuses, with a single command. Here is what I'm currently trying (and failing) with:
Here I'm trying to grab a list of statuses using
service $(ls /etc/init.d | grep "transmission-daemon") status
Here I'm trying to list all statuses, and then
grep for them.
service --status-all | grep "transmission-daemon"
This produces the following, which isn't much help:
How can I effectively achieve what I require with a single command, so that I can then continue piping to
awk for further customisation?
Desired example output:
transmission-daemon started transmission-daemon2 stopped transmission-daemon3 started