{"id":27433,"date":"2025-04-24T23:34:19","date_gmt":"2025-04-25T02:34:19","guid":{"rendered":"https:\/\/mastertrend.info\/?p=27433"},"modified":"2026-04-28T13:23:13","modified_gmt":"2026-04-28T16:23:13","slug":"systemctl","status":"publish","type":"post","link":"https:\/\/mastertrend.info\/en\/systemctl\/","title":{"rendered":"systemctl: Total Control in Linux in 12 Steps"},"content":{"rendered":"<h2>systemctl: 12 commands that master Linux \ud83d\ude80<\/h2>\n<p>The systemctl command has several features that are often overlooked. In addition to starting and stopping services in Linux, you can also list installed services and check their status. Let&#039;s do a quick review! \ud83d\ude80<\/p>\n<p><!-- No winning ad found for zone: below first paragraph! --><!-- No winning ad found for zone: native in content! --><\/p>\n<h2 id=\"the-systemctl-command\">What Is the Systemctl Command?<\/h2>\n<p>The command <a class=\"wpil_keyword_link\" href=\"https:\/\/mastertrend.info\/en\/chatgpt-recommendations\/\" target=\"_blank\" rel=\"noopener\" title=\"ChatGPT Recommendations: Top 4 in seconds! \ud83c\udfa5\ud83d\udcda\" data-wpil-keyword-link=\"linked\" data-wpil-monitor-id=\"7065\">systemctl<\/a> es la herramienta central de gesti\u00f3n del sistema init systemd, conocida principalmente como la herramienta que se usa para iniciar y detener servicios. Pero hay mucho m\u00e1s, como lo demuestra su p\u00e1gina de manual que tiene m\u00e1s de 1600 l\u00edneas. \ud83d\udcd6<\/p>\n<p>Because systemctl is a management tool, not just a service launcher, you can use it to access useful information about your system and its systemd services. \ud83d\udcbb<\/p>\n<p>Most Linux distributions have adopted systemd, but some have opted to retain the traditional SystemV init system. If you&#039;re not sure which one your distribution uses, it&#039;s easy to find out. We&#039;ll use the stat command to look at the init file.<\/p>\n<pre><code class=\"hljs bash\"><span class=\"hljs-built_in\">stat<\/span> \/sbin\/init <\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Using the stat command to see if a Linux installation uses SystemV or systemd.\" width=\"1010\" height=\"370\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>The \/sbin\/init executable file is the first process launched in SystemV-based distributions. In systemd-based distributions, a symbolic link of that name points to the systemd file.<\/p>\n<p>The first line of output shows us that on this Ubuntu test machine, \/sbin\/init is a symbolic link to the \/lib\/systemd\/systemd file. Clearly, this Linux installation uses systemd. If this were a SystemV-based distribution, the line would simply contain \u201cFile: \/sbin\/init.\u201d<\/p>\n<h2 id=\"interrogating-services-with-systemctl\">Interrogating Services With systemctl<\/h2>\n<p>Services are defined in unit files, and you&#039;ll see the word &quot;unit&quot; scattered throughout systemctl options. As an example, we can obtain a list of services with the list-units command using the \u2013type option.<\/p>\n<pre><code class=\"hljs php\">systemctl <span class=\"hljs-keyword\">list<\/span>-units --type=service<\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610363_948_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"The output of the systemctl list-units command, showing running and stopped services.\" width=\"1010\" height=\"625\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610363_948_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>The output is displayed in the less file viewer, allowing you to navigate and use the \/ key to search.<\/p>\n<ul>\n<li><strong>Unit<\/strong>: The name of the unit file.<\/li>\n<li><strong>Carry<\/strong>: If the service&#039;s unit file was read into memory without syntax errors, this column will contain &quot;loaded.&quot; This does not mean the service is active.<\/li>\n<li><strong>Asset<\/strong>: An overview of whether a service is active. An active service may not be running.<\/li>\n<li><strong>Sub<\/strong>: A more detailed view of whether a service is running. For example, an active service might be scheduled for a timer and may have exited its last run.<\/li>\n<li><strong>Description<\/strong>: A line of text intended to identify or describe the service.<\/li>\n<\/ul>\n<p>The display only includes active services. To see all services, we need to include the \u2013all option.<\/p>\n<pre><code class=\"hljs php\">systemctl <span class=\"hljs-keyword\">list<\/span>-units --all --type=service<\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610363_218_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"The output of the systemctl list-units command, showing all services.\" width=\"1010\" height=\"625\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610363_218_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>If viewing everything is overwhelming, we can filter the output with the \u2013state option.<\/p>\n<pre><code class=\"hljs php\">systemctl <span class=\"hljs-keyword\">list<\/span>-units --type=service --state=running<\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610363_378_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"The output of the systemctl list-units command, filtered to show only running services.\" width=\"1010\" height=\"625\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610363_378_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>The state option will accept running, stopped, enabled, disabled, and failed.<\/p>\n<p>To focus on failed services, use the \u2013failed option.<\/p>\n<pre><code class=\"hljs php\">systemctl <span class=\"hljs-keyword\">list<\/span>-units --failed<\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610364_932_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"The output of the systemctl list-units command, filtered to show only failed services. There are no failed services.\" width=\"1010\" height=\"240\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610364_932_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>There are no failed drives on this computer.<\/p>\n<p>If you see any failed services, use the list-dependencies option to check for unmet dependencies.<\/p>\n<pre><code class=\"hljs php\">systemctl <span class=\"hljs-keyword\">list<\/span>-dependencies sshd.service<\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610364_593_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"The output of the systemctl list-dependencies command showing the dependencies for the sshd service.\" width=\"1010\" height=\"625\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610364_593_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>Dependencies have a color-coded circle representing their status. This can be:<\/p>\n<ul>\n<li><strong>White Circle<\/strong>: Inactive or under maintenance<\/li>\n<li><strong>Green Dot<\/strong>: Asset.<\/li>\n<li><strong>White Point<\/strong>: Deactivating.<\/li>\n<li><strong>Red Dot<\/strong>: Failed or error.<\/li>\n<\/ul>\n<p>To check if a single service is enabled, use the is-enabled command and provide the name of the service&#039;s unit file.<\/p>\n<pre><code class=\"hljs python\">systemctl <span class=\"hljs-keyword\">es<\/span>-enabled htg-example.service<\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610364_509_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Using systemctl is-enabled to determine if a specific service is enabled.\" width=\"1010\" height=\"200\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610364_509_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<h2 id=\"controlling-services-with-systemctl\">Controlling Services With systemctl<\/h2>\n<p>Using systemctl to manage services is very simple and follows the same command format as the ones we&#039;ve seen so far. The biggest difference is that you&#039;ll need to use sudo to make changes to service status. We haven&#039;t done this so far because we&#039;ve only been reporting on service status.<\/p>\n<p>To start a service, use the start command followed by the service name.<\/p>\n<pre><code class=\"hljs css\"><span class=\"hljs-selector-tag\">sweat<\/span>\u00a0<span class=\"hljs-selector-tag\">systemctl<\/span>\u00a0<span class=\"hljs-selector-tag\">start<\/span>\u00a0<span class=\"hljs-selector-tag\">htg-example<\/span><span class=\"hljs-selector-class\">.service<\/span><\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610364_181_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Starting a service with the systemctl start command.\" width=\"1010\" height=\"180\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610364_181_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>If all goes well, you&#039;ll be silently returned to the command prompt. If you&#039;d prefer positive confirmation, you can verify this with the status command.<\/p>\n<pre><code class=\"hljs css\"><span class=\"hljs-selector-tag\">sweat<\/span>\u00a0<span class=\"hljs-selector-tag\">systemctl<\/span>\u00a0<span class=\"hljs-selector-tag\">status<\/span>\u00a0<span class=\"hljs-selector-tag\">htg-example<\/span><span class=\"hljs-selector-class\">.service<\/span><\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_854_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Checking the status of a service with the systemctl status command.\" width=\"1010\" height=\"590\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_854_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>Stopping a service is just as easy as starting it.<\/p>\n<pre><code class=\"hljs css\"><span class=\"hljs-selector-tag\">sweat<\/span>\u00a0<span class=\"hljs-selector-tag\">systemctl<\/span>\u00a0<span class=\"hljs-selector-tag\">stop<\/span>\u00a0<span class=\"hljs-selector-tag\">htg-example<\/span><span class=\"hljs-selector-class\">.service<\/span><\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_203_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Stopping a service with the systemctl stop command.\" width=\"1010\" height=\"175\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_203_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>You can restart a service without having to go through the two-step process of stopping and then starting it. <a title=\"Ubuntu won&#039;t start? \ud83d\ude80 Fix it in minutes.\" href=\"https:\/\/mastertrend.info\/en\/ubuntu-does-not-start\/\" target=\"_blank\" rel=\"noopener\" data-wpil-monitor-id=\"5614\">restart command<\/a> does it all for you.<\/p>\n<pre><code class=\"hljs css\"><span class=\"hljs-selector-tag\">sweat<\/span>\u00a0<span class=\"hljs-selector-tag\">systemctl<\/span>\u00a0<span class=\"hljs-selector-tag\">restart<\/span>\u00a0<span class=\"hljs-selector-tag\">htg-example<\/span><span class=\"hljs-selector-class\">.service<\/span><\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_846_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Restarting a service with the systemctl restart command.\" width=\"1010\" height=\"190\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_846_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>If you want a service to start at boot, you need to enable it.<\/p>\n<pre><code class=\"hljs css\"><span class=\"hljs-selector-tag\">sweat<\/span>\u00a0<span class=\"hljs-selector-tag\">systemctl<\/span>\u00a0<span class=\"hljs-selector-tag\">enable<\/span>\u00a0<span class=\"hljs-selector-tag\">htg-example<\/span><span class=\"hljs-selector-class\">.service<\/span><\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_437_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Enabling a service with the systemctl enable command.\" width=\"1010\" height=\"225\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_437_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>Note that this only specifies the service to start at boot; it doesn&#039;t start it immediately. If that&#039;s what you want, add the --now option.<\/p>\n<pre><code class=\"hljs css\"><span class=\"hljs-selector-tag\">sweat<\/span>\u00a0<span class=\"hljs-selector-tag\">systemctl<\/span>\u00a0<span class=\"hljs-selector-tag\">enable<\/span>\u00a0<span class=\"hljs-selector-tag\">--now<\/span>\u00a0<span class=\"hljs-selector-tag\">htg-example<\/span><span class=\"hljs-selector-class\">.service<\/span><\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_854_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Enabling and starting a service at the same time with the systemctl enable --now command.\" width=\"1010\" height=\"210\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_854_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>When you no longer need a service to start at boot, disable it.<\/p>\n<pre><code class=\"hljs css\"><span class=\"hljs-selector-tag\">sweat<\/span>\u00a0<span class=\"hljs-selector-tag\">systemctl<\/span>\u00a0<span class=\"hljs-selector-tag\">disable<\/span>\u00a0<span class=\"hljs-selector-tag\">htg-example<\/span><span class=\"hljs-selector-class\">.service<\/span><\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_595_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Disabling a service with the systemctl disable command.\" width=\"1010\" height=\"200\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610365_595_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>You can use the journalctl command, another part of systemd, to search for entries related to your service. The -u (unit) option allows you to specify the service you&#039;re interested in. With the -S (since) option, you can display entries that have occurred since the specified time.<\/p>\n<pre><code class=\"hljs css\"><span class=\"hljs-selector-tag\">journalctl<\/span>\u00a0<span class=\"hljs-selector-tag\">-S<\/span> \"08<span class=\"hljs-selector-pseudo\">:00<\/span><span class=\"hljs-selector-pseudo\">:00\"<\/span>\u00a0<span class=\"hljs-selector-tag\">-or<\/span>\u00a0<span class=\"hljs-selector-tag\">htg-example<\/span><span class=\"hljs-selector-class\">.service<\/span><\/code><\/pre>\n<figure>     <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610366_799_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" alt=\"Using the journalctl command to display system log entries related to a specific service.\" width=\"1010\" height=\"625\" data-img-url=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/12\/1733610366_799_Estos-12-comandos-de-systemctl-te-permitiran-tomar-el-control.png\" title=\"\"><\/figure>\n<p>Any tool that helps you <a title=\"Resource Usage in Linux \ud83d\udd27 Easily Optimize\" href=\"https:\/\/mastertrend.info\/en\/resource-usage-in-linux\/\" target=\"_blank\" rel=\"noopener\" data-wpil-monitor-id=\"5613\">obtain information about the operation<\/a> Your Linux distribution&#039;s internals will be invaluable, both for day-to-day management and for troubleshooting and diagnosing issues. The systemctl command isn&#039;t a single tool. It&#039;s more like a treasure trove of specialized tools, and it&#039;s well worth getting familiar with. \ud83d\udd27\ud83d\udee0\ufe0f<\/p>","protected":false},"excerpt":{"rendered":"<p>systemctl unlocks full control in Linux: 12 essential commands to manage services in seconds! \u26a1\ud83d\udcbb<\/p>","protected":false},"author":1,"featured_media":45967,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ai_generated_summary":"","iawp_total_views":33,"jnews-multi-image_gallery":[],"jnews_single_post":[],"jnews_primary_category":[],"jnews_social_meta":[],"jnews_review":[],"enable_review":"","type":"","name":"","summary":"","brand":"","sku":"","good":[],"bad":[],"score_override":"","override_value":"","rating":[],"price":[],"jnews_override_counter":[],"footnotes":""},"categories":[1435],"tags":[1445,1821,1558],"class_list":["post-27433","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutoriales","tag-evergreencontent","tag-linux","tag-techtips"],"_links":{"self":[{"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/posts\/27433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/comments?post=27433"}],"version-history":[{"count":0,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/posts\/27433\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/media\/45967"}],"wp:attachment":[{"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/media?parent=27433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/categories?post=27433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/tags?post=27433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}