{"id":24008,"date":"2024-01-31T13:20:22","date_gmt":"2024-01-31T13:20:22","guid":{"rendered":"https:\/\/linuxways.net\/?p=24008"},"modified":"2024-01-31T13:26:17","modified_gmt":"2024-01-31T13:26:17","slug":"list-services-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/list-services-debian-12\/","title":{"rendered":"How to List Services in Debian 12"},"content":{"rendered":"<p><strong>Services<\/strong> are background programs that keep waiting and are ready to use when needed. Some of these services that usually run on your system are <strong>DHCP Client, DNS, Power, <\/strong>and<strong> System Management <\/strong>services. At some point, you might need to list all services on your system because they are the key part of server management that helps you during the troubleshooting. While listing the services, you can stop those services that consume your system resources, thus improving your system performance.<\/p>\n<p>This guide aims to provide you with the various methods to list services in Debian 12.<\/p>\n<p><strong>Quick Outline<\/strong><\/p>\n<p><a href=\"#post-24008-_heading=h.64ls2fvx3fr5\"><strong>How to List Services in Debian 12<\/strong><\/a><\/p>\n<p><a href=\"#post-24008-_heading=h.4w0x1narknnt\"><strong>Conclusion<\/strong><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24008-_heading=h.64ls2fvx3fr5\"><\/a><strong>How to List Services in Debian 12<\/strong><\/h2>\n<p>The following are the commands used to list services in Debian 12:<\/p>\n<ul>\n<li><a href=\"#post-24008-_heading=h.jw7hpf1zal8x\"><strong>systemctl Command<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-_heading=h.dkjtvy9d1xd2\"><strong>service Command<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-_heading=h.v0yi6bpicns\"><strong>pstree Command<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24008-_heading=h.jw7hpf1zal8x\"><\/a><strong>1: Use the systemctl Command to List Services in Debian 12<\/strong><\/h2>\n<p><strong>systemctl <\/strong>command is a widely used command in Linux systems that are managed by the <strong>systemd,<\/strong> a default service manager. With <strong>systemctl <\/strong>command, you can view whether a specific service is enabled on your system. Further, it also helps you disable, restart, stop, or mask the services on your system. In case of any issue, check the current status of your services through the <strong>systemctl <\/strong>command. The basic syntax of using the <strong>systemctl <\/strong>command is written below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl <span class=\"br0\">&#91;<\/span>Options...<span class=\"br0\">&#93;<\/span> <span class=\"br0\">&#91;<\/span>Command NAME...<span class=\"br0\">&#93;<\/span><\/div><\/div>\n<p>Here, <strong>Options <\/strong>specify the output, and the <strong>Command NAME<\/strong> defines the service command. The details of each service is located in the <strong>\/usr\/lib\/systemd<\/strong> directory on Debian. Using the <strong>systemctl <\/strong>command on your system, you can display:<\/p>\n<ul>\n<li><a href=\"#post-24008-bookmark=id.xe8jfcyej8vq\"><strong>All Services<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-bookmark=id.dd5gk4yvsau4\"><strong>Enabled Services<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-bookmark=id.dehvz1keo1em\"><strong>Running Services<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-bookmark=id.4xsy4d41j1nc\"><strong>Active Services<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-bookmark=id.zergylc41g4d\"><strong>Disabled Services<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-bookmark=id.trasna91l6h7\"><strong>Detail Information of Running Service<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-bookmark=id.e0hfeiq07ue5\"><strong>Check Time Required by a Service to Boot<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><strong>1: List All Services on Debian 12<\/strong><\/h3>\n<p>The following command will list all the running services including enabled, running, stopped, and disabled services on your Debian system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl list-units <span class=\"re5\">--type<\/span>=service <span class=\"re5\">--all<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"752\" height=\"456\" class=\"wp-image-24037\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-1.png 752w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-1-300x182.png 300w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/p>\n<p>Press <strong>Q <\/strong>to exit the services list and return to the terminal. You can also use the <strong>systemctl<\/strong> command without the list-units parameter:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl <span class=\"re5\">--type<\/span>=service <span class=\"re5\">--all<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"457\" class=\"wp-image-24043\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-2.png 755w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-2-300x182.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/p>\n<p>You can also use a simple <strong>systemctl<\/strong> command without passing any arguments to list down all the loaded system units on Debian:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"747\" height=\"435\" class=\"wp-image-24054\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-3.png 747w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-3-300x175.png 300w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>2: List All Enabled Services on Debian 12<\/strong><\/h3>\n<p>The enabled services automatically start when you turn on your system. To display all the enabled services under <strong>systemd <\/strong>on Debian<strong>, <\/strong>execute the following <strong>systemctl <\/strong>command;<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl list-unit-files <span class=\"re5\">--state<\/span>=enabled<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"453\" class=\"wp-image-24067\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-4.png 703w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-4-300x193.png 300w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>3: List Running Services on Debian 12<\/strong><\/h3>\n<p>To quickly view the list of all running services on Debian, run the following command in the terminal:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl list-units <span class=\"re5\">--type<\/span>=service <span class=\"re5\">--state<\/span>=running<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"462\" class=\"wp-image-24085\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-5.png 750w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-5-300x185.png 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\n<p>In the above output:<\/p>\n<p><strong>UNIT: <\/strong>Name of the service.<\/p>\n<p><strong>LOAD: <\/strong>Verify whether the files are parsed by systemd or not.<\/p>\n<p><strong>ACTIVE:<\/strong> High-level state of the service.<\/p>\n<p><strong>SUB: <\/strong>Low-level state of the service.<\/p>\n<p><strong>DESCRIPTION:<\/strong> Detailed information about the service.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>4: List Active Services on Debian 12<\/strong><\/h3>\n<p>The following command will display the active services on your Debian:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl list-units <span class=\"re5\">--type<\/span>=service <span class=\"re5\">--state<\/span>=active<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"754\" height=\"455\" class=\"wp-image-24104\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-6.png 754w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-6-300x181.png 300w\" sizes=\"auto, (max-width: 754px) 100vw, 754px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>5: List Disabled Services on Debian 12<\/strong><\/h3>\n<p>Disabled services will not start automatically when you start a system. To view the disabled services on Debian, execute the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl list-unit-files <span class=\"re5\">--state<\/span>=disabled<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"455\" class=\"wp-image-24116\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-7.png 734w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-7-300x186.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>6: View Detail Information of Running Services on Debian 12<\/strong><\/h3>\n<p>You can also view the detailed information of any running service on your Debian system using the following <strong>systemctl <\/strong>command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl status <span class=\"br0\">&#91;<\/span>service_name<span class=\"br0\">&#93;<\/span><\/div><\/div>\n<p>Here, we want to get information related to <strong>snapd<\/strong> on Debian 12:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemctl status snapd<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"308\" class=\"wp-image-24125\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-8.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-8-300x125.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>7: Check Time Required by a Service to boot on Debian<\/strong><\/h3>\n<p>Each service requires a specific time to start on your system and to check the time, you can execute the below-given command that will display the time of all the services:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">systemd-analyze blame<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"442\" class=\"wp-image-24131\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-9.png 713w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-9-300x186.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24008-_heading=h.dkjtvy9d1xd2\"><\/a><strong>2: Use service Command to List Services in Debian 12<\/strong><\/h2>\n<p>Besides using the <strong>systemctl command<\/strong>, you can also use the <strong>service command<\/strong> to display all the services on your Debian system. By default, the <strong>service command-line utility<\/strong> is installed on Debian, however, if it is not, run the following apt command to install it:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> sysvinit-utils<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"652\" height=\"190\" class=\"wp-image-24139\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-10.png 652w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-10-300x87.png 300w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/p>\n<p>You can then use the <strong>service command <\/strong>on Debian to list:<\/p>\n<ul>\n<li><a href=\"#post-24008-bookmark=id.qngpp6jzp1pu\"><strong>All Services<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-bookmark=id.k0qybr1z1fgu\"><strong>Running Services<\/strong><\/a><\/li>\n<li><a href=\"#post-24008-bookmark=id.kajdvx204538\"><strong>Stopped Services<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><strong>1: List All Services on Debian 12<\/strong><\/h3>\n<p>Run the following command in the terminal to list all the services on Debian using the <strong>service command<\/strong>:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> service <span class=\"re5\">--status-all<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"455\" class=\"wp-image-24145\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-11.png 727w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-11-300x188.png 300w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>2: List Running Services on Debian 12<\/strong><\/h3>\n<p>To list only running services on Debian, execute the <strong>grep command <\/strong>along with the service utility:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> service <span class=\"re5\">--status-all<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">grep<\/span> <span class=\"st_h\">'\\[ + \\]'<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"286\" class=\"wp-image-24150\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-12.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-12-300x118.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>3: List Stopped Services on Debian 12<\/strong><\/h3>\n<p>You can also list services that are stopped on your Debian system by using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> service <span class=\"re5\">--status-all<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">grep<\/span> <span class=\"st_h\">'\\[ - \\]'<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"257\" class=\"wp-image-24158\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-13.png 699w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-13-300x110.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24008-_heading=h.v0yi6bpicns\"><\/a><strong>3: Use pstree Command to List Services in Debian 12<\/strong><\/h2>\n<p>The <strong>pstree<\/strong> command can also be used in Debian to display all the running services in a concise tree-like structure. It is a more convenient method compared to the above-given methods for displaying the list of services on your system.<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pstree<\/span><\/div><\/div>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"753\" height=\"455\" class=\"wp-image-24164\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-14.png 753w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-14-300x181.png 300w\" sizes=\"auto, (max-width: 753px) 100vw, 753px\" \/><\/p>\n<p>To sort the services, execute the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pstree<\/span> <span class=\"re5\">-n<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"449\" class=\"wp-image-24168\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-15.png 714w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24008-15-300x189.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/p>\n<p>To highlight the current processes, run the below command<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">pstree<\/span> <span class=\"re5\">-h<\/span><\/div><\/div>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24008-_heading=h.4w0x1narknnt\"><\/a><strong>Conclusion<\/strong><\/h2>\n<p><strong>Services<\/strong> are programs that start automatically in the background when you turn on your system. You can list down the services in Debian 12 to manage them efficiently. The <strong>systemctl<\/strong> is a powerful command used to list all of your system services. Other commands include <strong>service<\/strong> and <strong>pstree<\/strong> that help you list down the services on the terminal. We have discussed the detailed usage of these commands in the above section of this post. Follow these methods to list the services and stop them in case you don\u2019t need them on your Debian system.<\/p>","protected":false},"excerpt":{"rendered":"<p>To list services in Debian 12, you can use systemctl, service, and pstree commands. Learn the usage of these commands in this guide.<\/p>","protected":false},"author":115,"featured_media":24196,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-24008","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=24008"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24008\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/24196"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=24008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=24008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=24008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}