Score:1

List services start with specific name

ru flag

I have multiple services which start with a specific name. How can I list them in Linux.

For example some thing like that, sudo systemctl --name='*NAME.'

The main reason is that I am planning to write a script which will run in the background. The point of that script is to always check the status of that services and send emails when one of them stops (service monitoring alarm) and try to restart it.

Thanks in advanced.

hr flag
Many of the systemctl commands accept a filtering `PATTERN` - have you tried something like `systemctl list-units 'NAME*'` or `systemctl status 'NAME*'`?
user535733 avatar
cn flag
Why is this tagged 14.04?
guiverc avatar
cn flag
Ubuntu 14.04 LTS doesn't use systemd? so something is very wrong with your question; it doesn't match your tagged release. Please correct. Only supported releases of Ubuntu (*standard support*) are on-topic for this site. Ubuntu 14.04 LTS is in extended support and now Ubuntu 14.04 ESM thus only supported by Canonical via Ubuntu Advantage and off-topic here. Refer https://askubuntu.com/help/on-topic https://help.ubuntu.com/community/EOLUpgrades http://fridge.ubuntu.com/2019/05/02/ubuntu-14-04-trusty-tahr-reached-end-of-life-on-april-25-2019-esm-available/
M Fuat avatar
ru flag
I have removed the tag.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.