{"id":13947,"date":"2022-01-18T15:19:56","date_gmt":"2022-01-18T15:19:56","guid":{"rendered":"https:\/\/linuxways.net\/?p=13947"},"modified":"2022-01-18T15:19:56","modified_gmt":"2022-01-18T15:19:56","slug":"listing-services-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/listing-services-on-ubuntu-20-04\/","title":{"rendered":"Listing Services on Ubuntu 20.04"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>If you are the system administrator, you can see all the services like process manager, login, syslog, &#8230; running in the background on your device.<\/p>\n<p>These services help with how the system works and connects to other programs. And you can also list all these services on Ubuntu.<\/p>\n<p>Now we&#8217;re gonna teach you to list all services by using the systemctl command on Ubuntu 20.04.<\/p>\n<h2>The syntax of the systemctl command<\/h2>\n<p><strong>The syntax:<\/strong><\/p>\n<pre>$ systemctl [options] [command]<\/pre>\n<p>To list all the services, run:<\/p>\n<pre>$ systemctl --no-pager<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"942\" height=\"408\" class=\"wp-image-13948\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-295.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-295.png 942w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-295-300x130.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-295-768x333.png 768w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><\/p>\n<h2>Listing all unit files<\/h2>\n<p>Run the following command:<\/p>\n<pre>$ systemctl list-units --all --type=service --no-pager<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"942\" height=\"326\" class=\"wp-image-13949\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-296.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-296.png 942w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-296-300x104.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-296-768x266.png 768w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><\/p>\n<h2>Listing systemd unit files<\/h2>\n<p>Run:<\/p>\n<pre>$ systemctl list-unit-files --no-pager<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"943\" height=\"347\" class=\"wp-image-13950\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-297.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-297.png 943w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-297-300x110.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-297-768x283.png 768w\" sizes=\"auto, (max-width: 943px) 100vw, 943px\" \/><\/p>\n<h2>Combining grep command to search for specific unit file<\/h2>\n<p>The syntax:<\/p>\n<pre>$ systemctl list-unit-files --no-pager | grep service_name<\/pre>\n<p>For example, I want to search for \u201csession\u201d:<\/p>\n<pre>$ systemctl list-unit-files --no-pager | grep session<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"411\" class=\"wp-image-13951\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-298.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-298.png 945w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-298-300x130.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-298-768x334.png 768w\" sizes=\"auto, (max-width: 945px) 100vw, 945px\" \/><\/p>\n<h2>Listing systemd service unit files by state<\/h2>\n<p>We will combine the grep command to do this. For example, I will list systemd service unit files are in the enabled state:<\/p>\n<pre>$ systemctl list-unit-files | grep enabled<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"390\" class=\"wp-image-13952\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-299.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-299.png 993w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-299-300x118.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-299-768x302.png 768w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><\/p>\n<p>For example, I will list systemd service unit files are in the disabled state:<\/p>\n<pre>$ systemctl list-unit-files | grep disabled<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"994\" height=\"349\" class=\"wp-image-13953\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-300.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-300.png 994w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-300-300x105.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-300-768x270.png 768w\" sizes=\"auto, (max-width: 994px) 100vw, 994px\" \/><\/p>\n<h2>Listing services using pstree command<\/h2>\n<pre>$ pstree<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"995\" height=\"655\" class=\"wp-image-13954\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-301.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-301.png 995w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-301-300x197.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-301-768x506.png 768w\" sizes=\"auto, (max-width: 995px) 100vw, 995px\" \/><\/p>\n<h2>List the groups that use the most resources<\/h2>\n<p>Run the following command:<\/p>\n<pre>$ systemd-cgtop<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"995\" height=\"431\" class=\"wp-image-13955\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-302.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-302.png 995w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-302-300x130.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-302-768x333.png 768w\" sizes=\"auto, (max-width: 995px) 100vw, 995px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>We just taught you to list all services by using the systemctl command on Ubuntu 20.04.<\/p>\n<p>Thank you for referring!<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction If you are the system administrator, you can see all the services like process manager, login, syslog, &#8230; running in the background on your device. These services&hellip;<\/p>","protected":false},"author":1,"featured_media":14083,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[48,100],"class_list":["post-13947","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-services","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13947","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=13947"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13947\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/14083"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=13947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=13947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=13947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}