How to list all enabled services from systemctl?
How can I list all enabled
services from systemctl
?
I know systemctl
lists all services, but I would like to only get the enabled
ones.
services systemd
add a comment |
How can I list all enabled
services from systemctl
?
I know systemctl
lists all services, but I would like to only get the enabled
ones.
services systemd
what do you mean by enabled? You mean services that are running?
– Gen
Jul 5 '16 at 18:28
5
@Gen enabling a service is quite different from starting it. Seeman systemctl
.
– Jos
Jul 5 '16 at 18:35
Just so you know, I have updated my answer.
– user364819
May 8 '17 at 16:09
Fascinating. The lowest rated answer is the most "correct" answer, even though it is clearly not the best answer. This excellent question (and its answers) is an interesting example of how systemd violates the long-standing (and brilliant) design principles of Unix & Co. @FelipeAlvarez complains that the most-accepted answer assumes systemd follows the unix design philosopy, but systemd/systemctl can do exactly what he wants (most experienced users will just consider that complete bloat). I begin to see more clearly why Linus Torvalds is so vehemently critical of systemd.
– BISI
Dec 13 '18 at 18:20
add a comment |
How can I list all enabled
services from systemctl
?
I know systemctl
lists all services, but I would like to only get the enabled
ones.
services systemd
How can I list all enabled
services from systemctl
?
I know systemctl
lists all services, but I would like to only get the enabled
ones.
services systemd
services systemd
edited Oct 2 '18 at 13:39
Oldskool
16110
16110
asked Jul 5 '16 at 18:17
oceanBToceanBT
1,099267
1,099267
what do you mean by enabled? You mean services that are running?
– Gen
Jul 5 '16 at 18:28
5
@Gen enabling a service is quite different from starting it. Seeman systemctl
.
– Jos
Jul 5 '16 at 18:35
Just so you know, I have updated my answer.
– user364819
May 8 '17 at 16:09
Fascinating. The lowest rated answer is the most "correct" answer, even though it is clearly not the best answer. This excellent question (and its answers) is an interesting example of how systemd violates the long-standing (and brilliant) design principles of Unix & Co. @FelipeAlvarez complains that the most-accepted answer assumes systemd follows the unix design philosopy, but systemd/systemctl can do exactly what he wants (most experienced users will just consider that complete bloat). I begin to see more clearly why Linus Torvalds is so vehemently critical of systemd.
– BISI
Dec 13 '18 at 18:20
add a comment |
what do you mean by enabled? You mean services that are running?
– Gen
Jul 5 '16 at 18:28
5
@Gen enabling a service is quite different from starting it. Seeman systemctl
.
– Jos
Jul 5 '16 at 18:35
Just so you know, I have updated my answer.
– user364819
May 8 '17 at 16:09
Fascinating. The lowest rated answer is the most "correct" answer, even though it is clearly not the best answer. This excellent question (and its answers) is an interesting example of how systemd violates the long-standing (and brilliant) design principles of Unix & Co. @FelipeAlvarez complains that the most-accepted answer assumes systemd follows the unix design philosopy, but systemd/systemctl can do exactly what he wants (most experienced users will just consider that complete bloat). I begin to see more clearly why Linus Torvalds is so vehemently critical of systemd.
– BISI
Dec 13 '18 at 18:20
what do you mean by enabled? You mean services that are running?
– Gen
Jul 5 '16 at 18:28
what do you mean by enabled? You mean services that are running?
– Gen
Jul 5 '16 at 18:28
5
5
@Gen enabling a service is quite different from starting it. See
man systemctl
.– Jos
Jul 5 '16 at 18:35
@Gen enabling a service is quite different from starting it. See
man systemctl
.– Jos
Jul 5 '16 at 18:35
Just so you know, I have updated my answer.
– user364819
May 8 '17 at 16:09
Just so you know, I have updated my answer.
– user364819
May 8 '17 at 16:09
Fascinating. The lowest rated answer is the most "correct" answer, even though it is clearly not the best answer. This excellent question (and its answers) is an interesting example of how systemd violates the long-standing (and brilliant) design principles of Unix & Co. @FelipeAlvarez complains that the most-accepted answer assumes systemd follows the unix design philosopy, but systemd/systemctl can do exactly what he wants (most experienced users will just consider that complete bloat). I begin to see more clearly why Linus Torvalds is so vehemently critical of systemd.
– BISI
Dec 13 '18 at 18:20
Fascinating. The lowest rated answer is the most "correct" answer, even though it is clearly not the best answer. This excellent question (and its answers) is an interesting example of how systemd violates the long-standing (and brilliant) design principles of Unix & Co. @FelipeAlvarez complains that the most-accepted answer assumes systemd follows the unix design philosopy, but systemd/systemctl can do exactly what he wants (most experienced users will just consider that complete bloat). I begin to see more clearly why Linus Torvalds is so vehemently critical of systemd.
– BISI
Dec 13 '18 at 18:20
add a comment |
4 Answers
4
active
oldest
votes
systemctl list-unit-files | grep enabled
will list all enabled ones.
If you want which ones are currently running, you need systemctl | grep running
.
Use the one you're looking for. Enabled, doesn't mean it's running. And running doesn't mean it's enabled. They are two different things.
Enabled means the system will run the service on the next boot. So if you enable a service, you still need to manually start it, or reboot and it will start.
Running means it's actually running right now, but if it's not enabled, it won't restart when you reboot.
4
annoying to have to use an external tool (grep) to show this vital information. But thank you for showing us the way :)
– Felipe Alvarez
Feb 15 '17 at 2:43
20
@FelipeAlvarez Correct. But that's how Linux works. Many small binaries that work well with each other. systemctl does what is asked, it lists services. There is no filtering command built-in to systemctl because grep already exists and can do that well with any program's output. It's how it's always been :)
– Dorian
Feb 16 '17 at 16:01
3
I agree and so it should be. But, systemd already tries to do SO much that I wonder why it can't list enabled services?
– Felipe Alvarez
Feb 18 '17 at 0:45
3
systemctl | grep running
do not list anything to me! Even if something is running is only listed as for his status like:enabled, disabled, masked, static
– Cirelli94
Apr 13 '17 at 10:34
14
Simpler:systemctl list-unit-files --state=running
– Will
Sep 2 '17 at 10:40
|
show 10 more comments
man systemctl
states:
--state=
The argument should be a comma-separated list of unit
LOAD
,SUB
, orACTIVE
states. When listing units, show only those in the specified states. Use--state=failed
to show only failed units.
Explanation:
LOAD
: Reflects whether the unit definition was properly loaded.ACTIVE
: The high-level unit activation state, i.e. generalization of SUB
.SUB
: The low-level unit activation state, values depend on unit type.
Though you can also use this to only show enabled
units with:
systemctl list-unit-files --state=enabled
If a unit is enabled
that means that the system will start it on startup. Though setting something to enabled
doesn't actually also start
it so you will need to do that manually, or reboot the system after setting it to enabled
.
2
Doesn't answer the question;active
!=enabled
.
– Reinier Post
May 8 '17 at 15:31
@ReinierPost: I can't help it that the manpage doesn't give info on that, I provided the best answer I could with the information I had. As you can see, there is another answer which is accepted.
– user364819
May 8 '17 at 15:48
I know, but it's wrong (misleading) to keep a wrong answer up unmodified, and everybody seems to do it when this particular question is concerned (this is not the only instance).
– Reinier Post
May 8 '17 at 15:52
2
No, that's a reason to qualify your answer.
– Reinier Post
May 8 '17 at 15:53
4
To enable and start at the same time:systemctl enable --now ...
– Aurélien Ooms
Jul 29 '17 at 20:24
|
show 7 more comments
To list all the
systemd
service which are instate=active
andsub=running
systemctl list-units --type=service --state=running
To list all the
systemd
serice which are instate=active
and sub either running or exited
systemctl list-units --type=service --state=active
Hope this solves the problem.
add a comment |
To see 'enabled' services including these that are still under upstart/init run:
systemctl list-unit-files --type service --state enabled,generated
To see all of the currently running services run:
systemctl list-units --type service --state running
Unfortunately the names of the services can be different in the two lists - e.g.sshd
vs.ssh
andsyslog
vs.rsyslog
.
– OrangeDog
Jan 11 at 18:35
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f795226%2fhow-to-list-all-enabled-services-from-systemctl%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
systemctl list-unit-files | grep enabled
will list all enabled ones.
If you want which ones are currently running, you need systemctl | grep running
.
Use the one you're looking for. Enabled, doesn't mean it's running. And running doesn't mean it's enabled. They are two different things.
Enabled means the system will run the service on the next boot. So if you enable a service, you still need to manually start it, or reboot and it will start.
Running means it's actually running right now, but if it's not enabled, it won't restart when you reboot.
4
annoying to have to use an external tool (grep) to show this vital information. But thank you for showing us the way :)
– Felipe Alvarez
Feb 15 '17 at 2:43
20
@FelipeAlvarez Correct. But that's how Linux works. Many small binaries that work well with each other. systemctl does what is asked, it lists services. There is no filtering command built-in to systemctl because grep already exists and can do that well with any program's output. It's how it's always been :)
– Dorian
Feb 16 '17 at 16:01
3
I agree and so it should be. But, systemd already tries to do SO much that I wonder why it can't list enabled services?
– Felipe Alvarez
Feb 18 '17 at 0:45
3
systemctl | grep running
do not list anything to me! Even if something is running is only listed as for his status like:enabled, disabled, masked, static
– Cirelli94
Apr 13 '17 at 10:34
14
Simpler:systemctl list-unit-files --state=running
– Will
Sep 2 '17 at 10:40
|
show 10 more comments
systemctl list-unit-files | grep enabled
will list all enabled ones.
If you want which ones are currently running, you need systemctl | grep running
.
Use the one you're looking for. Enabled, doesn't mean it's running. And running doesn't mean it's enabled. They are two different things.
Enabled means the system will run the service on the next boot. So if you enable a service, you still need to manually start it, or reboot and it will start.
Running means it's actually running right now, but if it's not enabled, it won't restart when you reboot.
4
annoying to have to use an external tool (grep) to show this vital information. But thank you for showing us the way :)
– Felipe Alvarez
Feb 15 '17 at 2:43
20
@FelipeAlvarez Correct. But that's how Linux works. Many small binaries that work well with each other. systemctl does what is asked, it lists services. There is no filtering command built-in to systemctl because grep already exists and can do that well with any program's output. It's how it's always been :)
– Dorian
Feb 16 '17 at 16:01
3
I agree and so it should be. But, systemd already tries to do SO much that I wonder why it can't list enabled services?
– Felipe Alvarez
Feb 18 '17 at 0:45
3
systemctl | grep running
do not list anything to me! Even if something is running is only listed as for his status like:enabled, disabled, masked, static
– Cirelli94
Apr 13 '17 at 10:34
14
Simpler:systemctl list-unit-files --state=running
– Will
Sep 2 '17 at 10:40
|
show 10 more comments
systemctl list-unit-files | grep enabled
will list all enabled ones.
If you want which ones are currently running, you need systemctl | grep running
.
Use the one you're looking for. Enabled, doesn't mean it's running. And running doesn't mean it's enabled. They are two different things.
Enabled means the system will run the service on the next boot. So if you enable a service, you still need to manually start it, or reboot and it will start.
Running means it's actually running right now, but if it's not enabled, it won't restart when you reboot.
systemctl list-unit-files | grep enabled
will list all enabled ones.
If you want which ones are currently running, you need systemctl | grep running
.
Use the one you're looking for. Enabled, doesn't mean it's running. And running doesn't mean it's enabled. They are two different things.
Enabled means the system will run the service on the next boot. So if you enable a service, you still need to manually start it, or reboot and it will start.
Running means it's actually running right now, but if it's not enabled, it won't restart when you reboot.
edited Jul 5 '16 at 19:05
answered Jul 5 '16 at 18:52
DorianDorian
5,62511339
5,62511339
4
annoying to have to use an external tool (grep) to show this vital information. But thank you for showing us the way :)
– Felipe Alvarez
Feb 15 '17 at 2:43
20
@FelipeAlvarez Correct. But that's how Linux works. Many small binaries that work well with each other. systemctl does what is asked, it lists services. There is no filtering command built-in to systemctl because grep already exists and can do that well with any program's output. It's how it's always been :)
– Dorian
Feb 16 '17 at 16:01
3
I agree and so it should be. But, systemd already tries to do SO much that I wonder why it can't list enabled services?
– Felipe Alvarez
Feb 18 '17 at 0:45
3
systemctl | grep running
do not list anything to me! Even if something is running is only listed as for his status like:enabled, disabled, masked, static
– Cirelli94
Apr 13 '17 at 10:34
14
Simpler:systemctl list-unit-files --state=running
– Will
Sep 2 '17 at 10:40
|
show 10 more comments
4
annoying to have to use an external tool (grep) to show this vital information. But thank you for showing us the way :)
– Felipe Alvarez
Feb 15 '17 at 2:43
20
@FelipeAlvarez Correct. But that's how Linux works. Many small binaries that work well with each other. systemctl does what is asked, it lists services. There is no filtering command built-in to systemctl because grep already exists and can do that well with any program's output. It's how it's always been :)
– Dorian
Feb 16 '17 at 16:01
3
I agree and so it should be. But, systemd already tries to do SO much that I wonder why it can't list enabled services?
– Felipe Alvarez
Feb 18 '17 at 0:45
3
systemctl | grep running
do not list anything to me! Even if something is running is only listed as for his status like:enabled, disabled, masked, static
– Cirelli94
Apr 13 '17 at 10:34
14
Simpler:systemctl list-unit-files --state=running
– Will
Sep 2 '17 at 10:40
4
4
annoying to have to use an external tool (grep) to show this vital information. But thank you for showing us the way :)
– Felipe Alvarez
Feb 15 '17 at 2:43
annoying to have to use an external tool (grep) to show this vital information. But thank you for showing us the way :)
– Felipe Alvarez
Feb 15 '17 at 2:43
20
20
@FelipeAlvarez Correct. But that's how Linux works. Many small binaries that work well with each other. systemctl does what is asked, it lists services. There is no filtering command built-in to systemctl because grep already exists and can do that well with any program's output. It's how it's always been :)
– Dorian
Feb 16 '17 at 16:01
@FelipeAlvarez Correct. But that's how Linux works. Many small binaries that work well with each other. systemctl does what is asked, it lists services. There is no filtering command built-in to systemctl because grep already exists and can do that well with any program's output. It's how it's always been :)
– Dorian
Feb 16 '17 at 16:01
3
3
I agree and so it should be. But, systemd already tries to do SO much that I wonder why it can't list enabled services?
– Felipe Alvarez
Feb 18 '17 at 0:45
I agree and so it should be. But, systemd already tries to do SO much that I wonder why it can't list enabled services?
– Felipe Alvarez
Feb 18 '17 at 0:45
3
3
systemctl | grep running
do not list anything to me! Even if something is running is only listed as for his status like: enabled, disabled, masked, static
– Cirelli94
Apr 13 '17 at 10:34
systemctl | grep running
do not list anything to me! Even if something is running is only listed as for his status like: enabled, disabled, masked, static
– Cirelli94
Apr 13 '17 at 10:34
14
14
Simpler:
systemctl list-unit-files --state=running
– Will
Sep 2 '17 at 10:40
Simpler:
systemctl list-unit-files --state=running
– Will
Sep 2 '17 at 10:40
|
show 10 more comments
man systemctl
states:
--state=
The argument should be a comma-separated list of unit
LOAD
,SUB
, orACTIVE
states. When listing units, show only those in the specified states. Use--state=failed
to show only failed units.
Explanation:
LOAD
: Reflects whether the unit definition was properly loaded.ACTIVE
: The high-level unit activation state, i.e. generalization of SUB
.SUB
: The low-level unit activation state, values depend on unit type.
Though you can also use this to only show enabled
units with:
systemctl list-unit-files --state=enabled
If a unit is enabled
that means that the system will start it on startup. Though setting something to enabled
doesn't actually also start
it so you will need to do that manually, or reboot the system after setting it to enabled
.
2
Doesn't answer the question;active
!=enabled
.
– Reinier Post
May 8 '17 at 15:31
@ReinierPost: I can't help it that the manpage doesn't give info on that, I provided the best answer I could with the information I had. As you can see, there is another answer which is accepted.
– user364819
May 8 '17 at 15:48
I know, but it's wrong (misleading) to keep a wrong answer up unmodified, and everybody seems to do it when this particular question is concerned (this is not the only instance).
– Reinier Post
May 8 '17 at 15:52
2
No, that's a reason to qualify your answer.
– Reinier Post
May 8 '17 at 15:53
4
To enable and start at the same time:systemctl enable --now ...
– Aurélien Ooms
Jul 29 '17 at 20:24
|
show 7 more comments
man systemctl
states:
--state=
The argument should be a comma-separated list of unit
LOAD
,SUB
, orACTIVE
states. When listing units, show only those in the specified states. Use--state=failed
to show only failed units.
Explanation:
LOAD
: Reflects whether the unit definition was properly loaded.ACTIVE
: The high-level unit activation state, i.e. generalization of SUB
.SUB
: The low-level unit activation state, values depend on unit type.
Though you can also use this to only show enabled
units with:
systemctl list-unit-files --state=enabled
If a unit is enabled
that means that the system will start it on startup. Though setting something to enabled
doesn't actually also start
it so you will need to do that manually, or reboot the system after setting it to enabled
.
2
Doesn't answer the question;active
!=enabled
.
– Reinier Post
May 8 '17 at 15:31
@ReinierPost: I can't help it that the manpage doesn't give info on that, I provided the best answer I could with the information I had. As you can see, there is another answer which is accepted.
– user364819
May 8 '17 at 15:48
I know, but it's wrong (misleading) to keep a wrong answer up unmodified, and everybody seems to do it when this particular question is concerned (this is not the only instance).
– Reinier Post
May 8 '17 at 15:52
2
No, that's a reason to qualify your answer.
– Reinier Post
May 8 '17 at 15:53
4
To enable and start at the same time:systemctl enable --now ...
– Aurélien Ooms
Jul 29 '17 at 20:24
|
show 7 more comments
man systemctl
states:
--state=
The argument should be a comma-separated list of unit
LOAD
,SUB
, orACTIVE
states. When listing units, show only those in the specified states. Use--state=failed
to show only failed units.
Explanation:
LOAD
: Reflects whether the unit definition was properly loaded.ACTIVE
: The high-level unit activation state, i.e. generalization of SUB
.SUB
: The low-level unit activation state, values depend on unit type.
Though you can also use this to only show enabled
units with:
systemctl list-unit-files --state=enabled
If a unit is enabled
that means that the system will start it on startup. Though setting something to enabled
doesn't actually also start
it so you will need to do that manually, or reboot the system after setting it to enabled
.
man systemctl
states:
--state=
The argument should be a comma-separated list of unit
LOAD
,SUB
, orACTIVE
states. When listing units, show only those in the specified states. Use--state=failed
to show only failed units.
Explanation:
LOAD
: Reflects whether the unit definition was properly loaded.ACTIVE
: The high-level unit activation state, i.e. generalization of SUB
.SUB
: The low-level unit activation state, values depend on unit type.
Though you can also use this to only show enabled
units with:
systemctl list-unit-files --state=enabled
If a unit is enabled
that means that the system will start it on startup. Though setting something to enabled
doesn't actually also start
it so you will need to do that manually, or reboot the system after setting it to enabled
.
edited Aug 20 '18 at 16:19
Martin Thornton
2,52151830
2,52151830
answered Jul 5 '16 at 18:58
user364819
2
Doesn't answer the question;active
!=enabled
.
– Reinier Post
May 8 '17 at 15:31
@ReinierPost: I can't help it that the manpage doesn't give info on that, I provided the best answer I could with the information I had. As you can see, there is another answer which is accepted.
– user364819
May 8 '17 at 15:48
I know, but it's wrong (misleading) to keep a wrong answer up unmodified, and everybody seems to do it when this particular question is concerned (this is not the only instance).
– Reinier Post
May 8 '17 at 15:52
2
No, that's a reason to qualify your answer.
– Reinier Post
May 8 '17 at 15:53
4
To enable and start at the same time:systemctl enable --now ...
– Aurélien Ooms
Jul 29 '17 at 20:24
|
show 7 more comments
2
Doesn't answer the question;active
!=enabled
.
– Reinier Post
May 8 '17 at 15:31
@ReinierPost: I can't help it that the manpage doesn't give info on that, I provided the best answer I could with the information I had. As you can see, there is another answer which is accepted.
– user364819
May 8 '17 at 15:48
I know, but it's wrong (misleading) to keep a wrong answer up unmodified, and everybody seems to do it when this particular question is concerned (this is not the only instance).
– Reinier Post
May 8 '17 at 15:52
2
No, that's a reason to qualify your answer.
– Reinier Post
May 8 '17 at 15:53
4
To enable and start at the same time:systemctl enable --now ...
– Aurélien Ooms
Jul 29 '17 at 20:24
2
2
Doesn't answer the question;
active
!= enabled
.– Reinier Post
May 8 '17 at 15:31
Doesn't answer the question;
active
!= enabled
.– Reinier Post
May 8 '17 at 15:31
@ReinierPost: I can't help it that the manpage doesn't give info on that, I provided the best answer I could with the information I had. As you can see, there is another answer which is accepted.
– user364819
May 8 '17 at 15:48
@ReinierPost: I can't help it that the manpage doesn't give info on that, I provided the best answer I could with the information I had. As you can see, there is another answer which is accepted.
– user364819
May 8 '17 at 15:48
I know, but it's wrong (misleading) to keep a wrong answer up unmodified, and everybody seems to do it when this particular question is concerned (this is not the only instance).
– Reinier Post
May 8 '17 at 15:52
I know, but it's wrong (misleading) to keep a wrong answer up unmodified, and everybody seems to do it when this particular question is concerned (this is not the only instance).
– Reinier Post
May 8 '17 at 15:52
2
2
No, that's a reason to qualify your answer.
– Reinier Post
May 8 '17 at 15:53
No, that's a reason to qualify your answer.
– Reinier Post
May 8 '17 at 15:53
4
4
To enable and start at the same time:
systemctl enable --now ...
– Aurélien Ooms
Jul 29 '17 at 20:24
To enable and start at the same time:
systemctl enable --now ...
– Aurélien Ooms
Jul 29 '17 at 20:24
|
show 7 more comments
To list all the
systemd
service which are instate=active
andsub=running
systemctl list-units --type=service --state=running
To list all the
systemd
serice which are instate=active
and sub either running or exited
systemctl list-units --type=service --state=active
Hope this solves the problem.
add a comment |
To list all the
systemd
service which are instate=active
andsub=running
systemctl list-units --type=service --state=running
To list all the
systemd
serice which are instate=active
and sub either running or exited
systemctl list-units --type=service --state=active
Hope this solves the problem.
add a comment |
To list all the
systemd
service which are instate=active
andsub=running
systemctl list-units --type=service --state=running
To list all the
systemd
serice which are instate=active
and sub either running or exited
systemctl list-units --type=service --state=active
Hope this solves the problem.
To list all the
systemd
service which are instate=active
andsub=running
systemctl list-units --type=service --state=running
To list all the
systemd
serice which are instate=active
and sub either running or exited
systemctl list-units --type=service --state=active
Hope this solves the problem.
edited Sep 14 '17 at 4:51
d a i s y
3,34782444
3,34782444
answered Sep 14 '17 at 3:59
Ankit Kumar HoneyAnkit Kumar Honey
42132
42132
add a comment |
add a comment |
To see 'enabled' services including these that are still under upstart/init run:
systemctl list-unit-files --type service --state enabled,generated
To see all of the currently running services run:
systemctl list-units --type service --state running
Unfortunately the names of the services can be different in the two lists - e.g.sshd
vs.ssh
andsyslog
vs.rsyslog
.
– OrangeDog
Jan 11 at 18:35
add a comment |
To see 'enabled' services including these that are still under upstart/init run:
systemctl list-unit-files --type service --state enabled,generated
To see all of the currently running services run:
systemctl list-units --type service --state running
Unfortunately the names of the services can be different in the two lists - e.g.sshd
vs.ssh
andsyslog
vs.rsyslog
.
– OrangeDog
Jan 11 at 18:35
add a comment |
To see 'enabled' services including these that are still under upstart/init run:
systemctl list-unit-files --type service --state enabled,generated
To see all of the currently running services run:
systemctl list-units --type service --state running
To see 'enabled' services including these that are still under upstart/init run:
systemctl list-unit-files --type service --state enabled,generated
To see all of the currently running services run:
systemctl list-units --type service --state running
edited Jul 30 '18 at 18:07
Stephen Rauch
1,1546716
1,1546716
answered Jul 30 '18 at 16:51
nix-powernix-power
311
311
Unfortunately the names of the services can be different in the two lists - e.g.sshd
vs.ssh
andsyslog
vs.rsyslog
.
– OrangeDog
Jan 11 at 18:35
add a comment |
Unfortunately the names of the services can be different in the two lists - e.g.sshd
vs.ssh
andsyslog
vs.rsyslog
.
– OrangeDog
Jan 11 at 18:35
Unfortunately the names of the services can be different in the two lists - e.g.
sshd
vs. ssh
and syslog
vs. rsyslog
.– OrangeDog
Jan 11 at 18:35
Unfortunately the names of the services can be different in the two lists - e.g.
sshd
vs. ssh
and syslog
vs. rsyslog
.– OrangeDog
Jan 11 at 18:35
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f795226%2fhow-to-list-all-enabled-services-from-systemctl%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
what do you mean by enabled? You mean services that are running?
– Gen
Jul 5 '16 at 18:28
5
@Gen enabling a service is quite different from starting it. See
man systemctl
.– Jos
Jul 5 '16 at 18:35
Just so you know, I have updated my answer.
– user364819
May 8 '17 at 16:09
Fascinating. The lowest rated answer is the most "correct" answer, even though it is clearly not the best answer. This excellent question (and its answers) is an interesting example of how systemd violates the long-standing (and brilliant) design principles of Unix & Co. @FelipeAlvarez complains that the most-accepted answer assumes systemd follows the unix design philosopy, but systemd/systemctl can do exactly what he wants (most experienced users will just consider that complete bloat). I begin to see more clearly why Linus Torvalds is so vehemently critical of systemd.
– BISI
Dec 13 '18 at 18:20