• About Us
  • Announce
  • Privacy Policy
  • Contact us
MasterTrend News
  • Home
    • BLOG
    • TECHNICAL SERVICE
    • STORE
  • Tutorials
  • Hardware
  • Gaming
  • Mobiles
  • Security
  • Windows
  • AI
  • Software
  • Networks
  • News
  • en_USEnglish
    • es_ESSpanish
    • pt_BRPortuguese
    • fr_FRFrench
    • it_ITItalian
    • de_DEGerman
    • ko_KRKorean
    • jaJapanese
    • zh_CNChinese
    • ru_RURussian
    • thThai
    • pl_PLPolish
    • tr_TRTurkish
    • id_IDIndonesian
    • hi_INHindi
    • arArabic
    • sv_SESwedish
    • nl_NLDutch
No result
See all results
  • Home
    • BLOG
    • TECHNICAL SERVICE
    • STORE
  • Tutorials
  • Hardware
  • Gaming
  • Mobiles
  • Security
  • Windows
  • AI
  • Software
  • Networks
  • News
  • en_USEnglish
    • es_ESSpanish
    • pt_BRPortuguese
    • fr_FRFrench
    • it_ITItalian
    • de_DEGerman
    • ko_KRKorean
    • jaJapanese
    • zh_CNChinese
    • ru_RURussian
    • thThai
    • pl_PLPolish
    • tr_TRTurkish
    • id_IDIndonesian
    • hi_INHindi
    • arArabic
    • sv_SESwedish
    • nl_NLDutch
No result
See all results
MasterTrend News
No result
See all results
Start Tutorials

systemctl: Total Control in Linux in 12 Steps

MasterTrend Insights by MasterTrend Insights
April 25, 2025
in Tutorials
Reading time:Lectura de 9 minutos
TO TO
0
systemctl 12 commands that master Linux
5
SHARED
13
Views
Share on FacebookShare on Twitter

Contents

  1. systemctl: 12 commands that master Linux 🚀
  2. What Is the Systemctl Command?
  3. Interrogating Services With systemctl
  4. Controlling Services With systemctl
    1. Related Posts

systemctl: 12 commands that master Linux 🚀

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's do a quick review! 🚀

What Is the Systemctl Command?

The systemctl command is the central management tool for the systemd init system, primarily known as the tool used to start and stop services. But there's much more to it, as evidenced by its man page which has more than 1600 lines. 📖

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. 💻

Most Linux distributions have adopted systemd, but some have opted to retain the traditional SystemV init system. If you're not sure which one your distribution uses, it's easy to find out. We'll use the stat command to look at the init file.

stat /sbin/init 
Using the stat command to see if a Linux installation uses SystemV or systemd.

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.

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 “File: /sbin/init.”

Interrogating Services With systemctl

Services are defined in unit files, and you'll see the word "unit" scattered throughout systemctl options. As an example, we can obtain a list of services with the list-units command using the –type option.

systemctl list-units --type=service
The output of the systemctl list-units command, showing running and stopped services.

The output is displayed in the less file viewer, allowing you to navigate and use the / key to search.

  • Unit: The name of the unit file.
  • Carry: If the service's unit file was read into memory without syntax errors, this column will contain "loaded." This does not mean the service is active.
  • Asset: An overview of whether a service is active. An active service may not be running.
  • Sub: 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.
  • Description: A line of text intended to identify or describe the service.

The display only includes active services. To see all services, we need to include the –all option.

systemctl list-units --all --type=service
The output of the systemctl list-units command, showing all services.

If viewing everything is overwhelming, we can filter the output with the –state option.

systemctl list-units --type=service --state=running
The output of the systemctl list-units command, filtered to show only running services.

The state option will accept running, stopped, enabled, disabled, and failed.

To focus on failed services, use the –failed option.

systemctl list-units --failed
The output of the systemctl list-units command, filtered to show only failed services. There are no failed services.

There are no failed drives on this computer.

If you see any failed services, use the list-dependencies option to check for unmet dependencies.

systemctl list-dependencies sshd.service
The output of the systemctl list-dependencies command showing the dependencies for the sshd service.

Dependencies have a color-coded circle representing their status. This can be:

  • White Circle: Inactive or under maintenance
  • Green Dot: Asset.
  • White Point: Deactivating.
  • Red Dot: Failed or error.

To check if a single service is enabled, use the is-enabled command and provide the name of the service's unit file.

systemctl es-enabled htg-example.service
Using systemctl is-enabled to determine if a specific service is enabled.

Controlling Services With systemctl

Using systemctl to manage services is very simple and follows the same command format as the ones we've seen so far. The biggest difference is that you'll need to use sudo to make changes to service status. We haven't done this so far because we've only been reporting on service status.

To start a service, use the start command followed by the service name.

sweat systemctl start htg-example.service
Starting a service with the systemctl start command.

If all goes well, you'll be silently returned to the command prompt. If you'd prefer positive confirmation, you can verify this with the status command.

sweat systemctl status htg-example.service
Checking the status of a service with the systemctl status command.

Stopping a service is just as easy as starting it.

sweat systemctl stop htg-example.service
Stopping a service with the systemctl stop command.

You can restart a service without having to go through the two-step process of stopping and then starting it. restart command does it all for you.

sweat systemctl restart htg-example.service
Restarting a service with the systemctl restart command.

If you want a service to start at boot, you need to enable it.

sweat systemctl enable htg-example.service
Enabling a service with the systemctl enable command.

Note that this only specifies the service to start at boot; it doesn't start it immediately. If that's what you want, add the --now option.

sweat systemctl enable --now htg-example.service
Enabling and starting a service at the same time with the systemctl enable --now command.

When you no longer need a service to start at boot, disable it.

sweat systemctl disable htg-example.service
Disabling a service with the systemctl disable command.

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're interested in. With the -S (since) option, you can display entries that have occurred since the specified time.

journalctl -S "08:00:00" -or htg-example.service
Using the journalctl command to display system log entries related to a specific service.

Any tool that helps you obtain information about the operation Your Linux distribution's internals will be invaluable, both for day-to-day management and for troubleshooting and diagnosing issues. The systemctl command isn't a single tool. It's more like a treasure trove of specialized tools, and it's well worth getting familiar with. 🔧🛠️

Share this:
6FacebookLinkedInPinterestXRedditTumblrBlueskyThreadsShare
6
SHARES

Related Articles:

  • Tips for Windows console
    Tips for Windows console
    20 Windows Console Commands. Learn More Now!
  • Middle Mouse Button: 9 Quick Ways to Fix It on YouTube
    Middle mouse button not working on YouTube:…
    Middle mouse button not working on YouTube? 😒 Discover 9 quick fixes to get it working again 🚀🖱️
  • The Best ADB Commands Every Android User Should Know
    ADB Commands: Activate Secret Features on Your Android 🚀🔓
    ADB commands let you control your Android from your PC, activate hidden options, and optimize your phone with ease. 📲⚙️
  • How to Check RAM in Windows 11 and Optimize Your PC Today
    How to Check RAM in Windows 11: 6 Easy Methods 🛠️💻
    How to check RAM in Windows 11 is key to improving your PC 🛠️💻 Discover 6 quick and effective ways…
  • Intel and AMD CPU Equivalents
    Intel and AMD CPU Equivalents
    Looking for Intel and AMD processor equivalents? Find everything you need to know in our dedicated guide. Learn more now!
  • Habits to Keep Resource Usage Low in Linux
    Resource Usage in Linux 🔧 Easily Optimize
    Resource Usage in Linux: Discover key habits to optimize your system and keep your PC running fast. 🖥️💡

Related Posts

  • Checkout
  • Bios Dump (binaries, *.bin *.rom) 2024
  • ZOTAC Confirms GeForce RTX 5090 with 32 GB of GDDR7
  • Optimize your Memory: Free up your RAM – Windows 10 or 11
  • How to choose a graphics card
  • How to configure AdGuard DNS on Windows 10 and 11
  • Broken Notebook Screen: How to Fix!
  • How to translate WhatsApp messages (4 methods)
Tags: Evergreen ContentLinuxTechTips
Previous Post

Megatransfer: The new era of RAM speed ⚡

Next publication

How to Use Traceroute: Master Your Network Now 🛠️

MasterTrend Insights

MasterTrend Insights

Our editorial team shares in-depth reviews, tutorials, and recommendations to help you get the most out of your digital devices and tools.

Next publication
How to Use Traceroute to Identify Network Problems

How to Use Traceroute: Master Your Network Now 🛠️

5 2 votes
Article Rating
Subscribe
Access
Notify of
guest
guest
0 Comments
Oldest
Newest Most voted
Online Comments
See all comments

Stay Connected

  • 976 Fans
  • 118 Followers
  • 1.4k Followers
  • 1.8k Subscribers

Don't miss the latest in technology and gaming.
Exclusive tips, how-to guides, and analysis every day.

Subscription Form
  • Tendencies
  • Comments
  • Last
12 Best Alternatives to Lucky Patcher for Android

Lucky Patcher Alternatives: 12 Better and Easy Apps! 🎮⚡

May 12, 2025
How to add a clock to the Windows 11 desktop: 3 surefire tricks!

How to add a clock to your Windows 11 desktop: Get more done in minutes! ⏱️

May 1, 2025
How to use AdGuard DNS on Android in 2024

How to use AdGuard DNS on Android in 2025

February 11, 2025
How to force 4G LTE only mode on Android

How to force 4G LTE only mode on Android in 2025

February 10, 2025
Gmail Features on Android: Save Time with 5 Tips

Gmail Features on Android: 5 Tricks You Didn't Know About! 📱✨

12
Motherboard repair - Repair Motherboards

Notebook Motherboard Repair

10
Install Windows 11 Home without Internet

Install Windows 11 Home without Internet

10
How to Back Up Drivers in Windows 11/10 in 4 Steps!

How to Back Up Drivers in Windows 11/10: Avoid Errors! 🚨💾

10
How to Fix High Ping in Online Games - Alter text: Fantasy game characters in combat in a medieval sunset landscape with "Fix ping problem" text and a Wi-Fi symbol with "800ms" illustrating how to fix high ping in online games.

How to Fix High Ping in Online Games 🚀 Improve your connection now

July 23, 2025
Curing Vampirism in Oblivion Remastered: 3 Methods - Alt text: Vampire character with pale eyes and pale skin in a medieval room with stone walls and a lit fire, a scene from the video game The Elder Scrolls IV: Oblivion, illustrating how to cure vampirism.

Curing vampirism in Oblivion Remastered: Is it worth it? 🤔✨

July 23, 2025
Creating Multiple Folders in Windows - Alt text: Digital interface with PowerShell commands in Windows displaying the text "Create Multiple Folders", illustrating the process of creating multiple folders simultaneously in the Windows operating system.

Create multiple folders in Windows 🚀 Save time NOW with CMD and PowerShell

July 23, 2025
Is your Android phone running slow? 3 secret tricks to speed it up now - Alt text: Excited woman showing a phone with an image of a man on a fast-moving roller coaster, next to the Android logo, illustrating secret tricks to speed up a slow Android phone.

Is your Android phone running slow? ⚡ Activate this and forget about slowness today!

July 23, 2025

Recent News

How to Fix High Ping in Online Games - Alter text: Fantasy game characters in combat in a medieval sunset landscape with "Fix ping problem" text and a Wi-Fi symbol with "800ms" illustrating how to fix high ping in online games.

How to Fix High Ping in Online Games 🚀 Improve your connection now

July 23, 2025
13
Curing Vampirism in Oblivion Remastered: 3 Methods - Alt text: Vampire character with pale eyes and pale skin in a medieval room with stone walls and a lit fire, a scene from the video game The Elder Scrolls IV: Oblivion, illustrating how to cure vampirism.

Curing vampirism in Oblivion Remastered: Is it worth it? 🤔✨

July 23, 2025
45
Creating Multiple Folders in Windows - Alt text: Digital interface with PowerShell commands in Windows displaying the text "Create Multiple Folders", illustrating the process of creating multiple folders simultaneously in the Windows operating system.

Create multiple folders in Windows 🚀 Save time NOW with CMD and PowerShell

July 23, 2025
8
Is your Android phone running slow? 3 secret tricks to speed it up now - Alt text: Excited woman showing a phone with an image of a man on a fast-moving roller coaster, next to the Android logo, illustrating secret tricks to speed up a slow Android phone.

Is your Android phone running slow? ⚡ Activate this and forget about slowness today!

July 23, 2025
8
MasterTrend News logo

MasterTrend Info is your go-to source for technology: discover news, tutorials, and analysis on hardware, software, gaming, mobile devices, and artificial intelligence. Subscribe to our newsletter and don't miss any trends.

Follow us

Browse by Category

  • Gaming
  • Hardware
  • AI
  • Mobiles
  • News
  • Networks
  • Security
  • Software
  • Tutorials
  • Windows

Recent News

How to Fix High Ping in Online Games - Alter text: Fantasy game characters in combat in a medieval sunset landscape with "Fix ping problem" text and a Wi-Fi symbol with "800ms" illustrating how to fix high ping in online games.

How to Fix High Ping in Online Games 🚀 Improve your connection now

July 23, 2025
Curing Vampirism in Oblivion Remastered: 3 Methods - Alt text: Vampire character with pale eyes and pale skin in a medieval room with stone walls and a lit fire, a scene from the video game The Elder Scrolls IV: Oblivion, illustrating how to cure vampirism.

Curing vampirism in Oblivion Remastered: Is it worth it? 🤔✨

July 23, 2025
  • About Us
  • Announce
  • Privacy Policy
  • Contact us

Copyright © 2025 https://mastertrend.info/ - All rights reserved. All trademarks are property of their respective owners.

es_ES Spanish
es_ES Spanish
en_US English
pt_BR Portuguese
fr_FR French
it_IT Italian
ru_RU Russian
de_DE German
zh_CN Chinese
ko_KR Korean
ja Japanese
th Thai
hi_IN Hindi
ar Arabic
tr_TR Turkish
pl_PL Polish
id_ID Indonesian
nl_NL Dutch
sv_SE Swedish
No result
See all results
  • en_USEnglish
    • es_ESSpanish
    • pt_BRPortuguese
    • fr_FRFrench
    • it_ITItalian
    • de_DEGerman
    • ko_KRKorean
    • jaJapanese
    • zh_CNChinese
    • ru_RURussian
    • pl_PLPolish
    • id_IDIndonesian
    • tr_TRTurkish
    • hi_INHindi
    • thThai
    • arArabic
    • sv_SESwedish
    • nl_NLDutch
  • Gaming
  • Hardware
  • AI
  • Mobiles
  • News
  • Networks
  • Security
  • Software
  • Tutorials
  • Windows

Copyright © 2025 https://mastertrend.info/ - All rights reserved. All trademarks are property of their respective owners.

Comment Author Info
:wpds_smile::wpds_grin::wpds_wink::wpds_mrgreen::wpds_neutral::wpds_twisted::wpds_arrow::wpds_shock::wpds_unamused::wpds_cool::wpds_evil::wpds_oops::wpds_razz::wpds_roll::wpds_cry::wpds_eek::wpds_lol::wpds_mad::wpds_sad::wpds_exclamation::wpds_question::wpds_idea::wpds_hmm::wpds_beg::wpds_whew::wpds_chuckle::wpds_silly::wpds_envy::wpds_shutmouth:
wpDiscuz
RedditBlueskyXMastodonHacker News
Share this:
MastodonVKWhatsAppTelegramSMSHacker NewsLineMessenger
Your Mastodon Instance