Ubuntu systemctl command and Mode switch

Source: Internet
Author: User

Reprint http://blog.csdn.net/jun2016425/article/details/53100963/

1. vim/etc/default/Grub        #GRUB_CMDLINE_LINUX_DEFAULT="quiet Splash"          grub_cmdline_linux="text"        # Uncomment to disable Graphical Terminal (Grub-pc only)        grub_terminal=console2. update-  Grub3. Systemctl set-default multi-4. Systemctl Start LIGHTDM

Reprint http://blog.csdn.net/zhengjie19/article/details/49069767

This article records some common uses of systemd, most of which I will use myself.

    1. Startup level Configuration
      Because of the work needs, often in the virtual machine installed all kinds of Linux systems, and most of the time, we need just a text interface, can be through the host SSH to the VM, the graphical interface does not need to play, wasted CPU and memory, through the SYSTEMCTL command configuration by default into the text interface, Just one line:

      Systemctl Set-default Multi-user.target

      If you want to cut back to the graphical interface, the corresponding:

      Systemctl Set-default Graphical.target

    2. Start Service on Boot

      Systemctl Enable ***.service

    3. Stop the boot start service

      Systemctl Disable ***.service

    4. Start/stop/Restart service

      Systemctl Start/stop/restart ***.service

    5. Querying service Status

      Systemctl Status ***.service

    6. Execute commands on the remote machine, like SSH [email protected] ""

      systemctl-h [email protected]

    7. Lists the system services, and the TAB key can be used to correlate all supported unit types

      SYSTEMCTL-T Service

    8. Lists the status of all loaded units

      Systemctl-a

    9. List the loaded units/sockets/timers

      Systemctl list-units [Pattern]
      Systemctl list-sockets [Pattern]
      Systemctl list-timers [Pattern]

    10. Query whether a service is active, take sshd.serice as an example

      Systemctl is-active Sshd.service

    11. View the configuration file for a service directly, take Sshd.serice as an example

      Systemctl Cat Sshd.service

    12. View the dependencies of a service, take Sshd.serice as an example

      Systemctl list-dependencies Sshd.service

    13. View environment variables

      Systemctl show-environment

Ubuntu systemctl command and Mode switch

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.