Home > System Tutorial > LINUX > The Art of Restarting Debian

The Art of Restarting Debian

William Shakespeare
Release: 2025-03-17 09:19:11
Original
809 people have browsed it

Several methods exist for restarting a Debian system from the command line. This guide outlines the most common and effective approaches.

Method 1: The reboot Command

The simplest method is using the reboot command. This requires root privileges:

sudo reboot
Copy after login

You'll be prompted for your password.

Method 2: The systemctl Command

The systemctl command, a powerful systemd tool, also offers a reboot function:

sudo systemctl reboot
Copy after login

This command also requires root access.

Method 3: The /sbin/reboot Command

For an immediate, uninterruptible reboot, use this command:

/sbin/reboot
Copy after login

This command executes a reboot without delay.

Method 4: The shutdown Command

The shutdown command, primarily used for system shutdown, can initiate a reboot using the -r flag. For an immediate reboot:

sudo shutdown -r now
Copy after login

To schedule a reboot in, for example, five minutes:

sudo shutdown -r  5
Copy after login

Method 5: The init Command

The init command manages run levels. Run level 6 initiates a reboot:

sudo init 6
Copy after login

Emergency Reboot: Magic SysRq Key

The Magic SysRq key offers a last-resort method for rebooting a frozen system. This is a kernel-level operation and should only be used in emergencies as it bypasses normal shutdown procedures. Use with caution, as data loss is possible. The process involves two commands:

echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
Copy after login

Conclusion

Debian provides multiple command-line options for rebooting. Choose the method that best suits your needs and comfort level. Remember to use sudo where necessary to execute commands with root privileges.

The Art of Restarting Debian

The above is the detailed content of The Art of Restarting Debian. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template