How To Shutdown or Restart Linux with Commands

In the world of Linux, the command line interface is a powerful tool that can be used to perform a wide range of tasks. One such task is shutting down or restarting our computers directly from the terminal. This can be a useful time-saving technique that allows us to execute these tasks quickly and easily with simple commands.

In this tutorial, we will explore several ways to shut down or restart our Linux computers using command line instructions. By leveraging the power of the terminal, we can achieve these tasks with ease and efficiency. It's important to note, however, that these commands must be executed with root permissions to ensure proper functionality.

With this knowledge at our fingertips, we can streamline our workflow and take advantage of the many benefits of using Linux as our operating system. Whether we're seasoned Linux users or just starting out, the ability to control our computers from the command line is a valuable skill that can save us time and effort in our daily tasks.

Commands to Shutdown or Restart Linux

So if you're ready to take your Linux skills to the next level, join us as we explore the world of command line shutdowns and restarts. With a little bit of practice and some basic knowledge, you'll be able to master these techniques and become a more efficient and effective Linux user.

1. Shutdown

It is one of the commands best known for its simplicity and effectiveness.

The syntax to use with shutdown is as follows:

shutdown [option] [time] [message]

For example, if we want the equipment to turn off in 10 minutes we will use the following syntax:

shutdown -h 10

If we want to display a specific message indicating that the device will be turned off, we will use the following syntax:

shutdown -h 10 "The computer will be turned off, please save your work"

To see all the options of this command we will execute the following:

shutdown -help

To restart the computer we will execute the following syntax.

shutdown -r +3

2. Halt

The -h parameter allows us to stop the machine. If we execute the halt command exclusively, the computer will turned off immediately without the possibility of preventing it.

3. Poweroff

The command line interface in Linux is a powerful tool that can perform a wide range of tasks, including shutting down or restarting computers directly from the terminal. This technique can save time and effort and is a valuable skill for both seasoned and novice Linux users. However, it's important to note that executing these commands requires root permissions for proper functionality. One command that fulfills the fundamental role of turning off the machine is available, but it takes longer to write the changes before proceeding with the shutdown of the equipment. With practice and basic knowledge, mastering these techniques can make you a more efficient and effective Linux user.

With this command we can use two additional parameters:

-f (force poweroff)

-w (log the shutdown in /vat/log/wtmp)

4. Reboot

The reboot command is used to restart the computer and offers various parameters for shutting down the machine. Its syntax is simple, just type "reboot" and hit enter to initiate the restart process. 

By default, executing reboot without any parameters will turn off the system and restart it. 

reboot -p allows us to restart the system and not activate it again.

reboot - f forces the restart of the computer.

Additionally, we can use parameters such as closing the session to refresh the operating system. 

These options provide practical and useful ways to shut down or restart Linux.

It might be interesting

Unlocking the Potential of a Game Engines

Are you looking for a way to create the best gaming experience possible? Look no further than a game engine. A game engine is a toolset of technologies used to create interactive video games. It is the original software developed to provide an environment to create, run, and play games. A well-designed game engine combines three-dimensional graphics; calculation of collisions with objects; volumetric game world; sound component.

Epic Games unveiled RealityScan, a 3D model creation app

Epic Games has released the RealityScan app for creating 3D objects with the camera. For now, it is only available for iPhone owners.

Tencent: The largest internet portal in China

instant messenger is the product that gives recognition to Tencent which is the largest internet portal in China. Recently, they have reported about the number of users on its QZone social networking service.

Top 10 Domain Name Value Assessment Sites

This article presents the 10 best domain name valuation sites . In fact, estimating the value of your domains becomes very easy with these best domain name valuation sites.