国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
How to shut down correctly?
How to quickly restart the system?
What should you pay attention to before shutting down or restarting?
Home System Tutorial LINUX How to shut down or reboot a Linux system from the command line?

How to shut down or reboot a Linux system from the command line?

Jun 21, 2025 am 12:49 AM

To correctly shut down or restart the Linux system, use the corresponding commands and pay attention to permissions and operation details. 1. Sudo shutdown -h now can be shut down immediately, or sudo shutdown -h 10 can be shut down regularly, and notification messages can be attached; 2. Sudo reboot or sudo shutdown -r now can be shut down. Before operation, you should save the work, confirm that no other users are online, ensure that the server can be connected remotely, and avoid frequent power outages. Master these key points to safely perform shutdown or restart operations.

How to shut down or reboot a Linux system from the command line?

Shut down or restarting the Linux system is not complicated. The key is to use the right command and pay attention to the current user permissions. The two most commonly used commands are shutdown and reboot , but how to use them and when depends on your actual scenario.

How to shut down correctly?

In Linux, ordinary users usually do not have permission to shut down directly and need to use sudo permission to execute commands. The most common way is to use the shutdown command:

  • Turn off the power immediately:
     sudo shutdown -h now
  • Timely shutdown (for example, after 10 minutes):
     sudo shutdown -h 10

Here -h means halt (stop the system), now means execution immediately. If you want to notify other logged in users in advance that the system will be closed soon, you can add a message, such as:

 sudo shutdown -h 5 "System will shutdown in 5 minutes!"

How to quickly restart the system?

If you just want to restart instead of shutting down, you can use the reboot command directly:

 sudo reboot

This command is simple and direct, suitable for use after updating the kernel or service configuration. It will immediately terminate all processes and restart the system, so make sure there are no important tasks running.

You can also use the shutdown command to restart:

 sudo shutdown -r now

Here -r means reboot.

What should you pay attention to before shutting down or restarting?

Although these commands may seem simple, improper operation may lead to data loss or file system corruption. The following points need to be noted:

  • Save the ongoing work : the system will force the process to end after the command is executed, and unsaved data may be lost.
  • Confirm that no other users are online : you can use the who command to check which users are currently logged in.
  • If it is a remote server, make sure to reconnect : especially after restarting, if there is a problem with the network or SSH configuration, you may lose control.
  • Do not frequently power off instead of shutting down the power : unplugging the power supply or shutting down the virtual machine may cause damage to the system files.

Basically that's it. Remember a few common commands and cooperate with a little bit of care to safely shut down or restart.

The above is the detailed content of How to shut down or reboot a Linux system from the command line?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1502
276
How to troubleshoot DNS issues on a Linux machine? How to troubleshoot DNS issues on a Linux machine? Jul 07, 2025 am 12:35 AM

When encountering DNS problems, first check the /etc/resolv.conf file to see if the correct nameserver is configured; secondly, you can manually add public DNS such as 8.8.8.8 for testing; then use nslookup and dig commands to verify whether DNS resolution is normal. If these tools are not installed, you can first install the dnsutils or bind-utils package; then check the systemd-resolved service status and configuration file /etc/systemd/resolved.conf, and set DNS and FallbackDNS as needed and restart the service; finally check the network interface status and firewall rules, confirm that port 53 is not

Install Guacamole for Remote Linux/Windows Access in Ubuntu Install Guacamole for Remote Linux/Windows Access in Ubuntu Jul 08, 2025 am 09:58 AM

As a system administrator, you may find yourself (today or in the future) working in an environment where Windows and Linux coexist. It is no secret that some big companies prefer (or have to) run some of their production services in Windows boxes an

How to Install NodeJS 14 / 16 & NPM on Rocky Linux 8 How to Install NodeJS 14 / 16 & NPM on Rocky Linux 8 Jul 13, 2025 am 09:09 AM

Built on Chrome’s V8 engine, Node.JS is an open-source, event-driven JavaScript runtime environment crafted for building scalable applications and backend APIs. NodeJS is known for being lightweight and efficient due to its non-blocking I/O model and

How to find my private and public IP address in Linux? How to find my private and public IP address in Linux? Jul 09, 2025 am 12:37 AM

In Linux systems, 1. Use ipa or hostname-I command to view private IP; 2. Use curlifconfig.me or curlipinfo.io/ip to obtain public IP; 3. The desktop version can view private IP through system settings, and the browser can access specific websites to view public IP; 4. Common commands can be set as aliases for quick call. These methods are simple and practical, suitable for IP viewing needs in different scenarios.

System requirements to install linux System requirements to install linux Jul 20, 2025 am 03:49 AM

Linuxcanrunonmodesthardwarewithspecificminimumrequirements.A1GHzprocessor(x86orx86_64)isneeded,withadual-coreCPUrecommended.RAMshouldbeatleast512MBforcommand-lineuseor2GBfordesktopenvironments.Diskspacerequiresaminimumof5–10GB,though25GBisbetterforad

How to Install MySQL 8.0 on Rocky Linux and AlmaLinux How to Install MySQL 8.0 on Rocky Linux and AlmaLinux Jul 12, 2025 am 09:21 AM

Written in C, MySQL is an open-source, cross-platform, and one of the most widely used Relational Database Management Systems (RDMS). It’s an integral part of the LAMP stack and is a popular database management system in web hosting, data analytics,

Ubuntu 25.04 'Plucky Puffin”: A Bold Leap Forward with GNOME 48 and HDR Brilliance Ubuntu 25.04 'Plucky Puffin”: A Bold Leap Forward with GNOME 48 and HDR Brilliance Jul 12, 2025 am 09:28 AM

Ubuntu has long stood as a bastion of accessibility, polish, and power in the Linux ecosystem. With the arrival of Ubuntu 25.04, codenamed “Plucky Puffin”, Canonical has once again demonstrated its commitment to delivering a

How to Install MongoDB on Rocky Linux and AlmaLinux How to Install MongoDB on Rocky Linux and AlmaLinux Jul 12, 2025 am 09:29 AM

MongoDB is a high-performance, highly scalable document-oriented NoSQL database built to manage heavy traffic and vast amounts of data. Unlike traditional SQL databases that store data in rows and columns within tables, MongoDB structures data in a J

See all articles