System and processes

The reboot command

Restarts the machine right away. It takes no time argument but warns logged-in users.

Syntax

sudo reboot [opciones]Try it in the terminal →

Most useful options

-f, --forceForces the restart without contacting the init system. Filesystems may not be unmounted properly
-n, --no-syncDoes not sync the disks before restarting. It is faster, but pending data may be lost
-w, --wtmp-onlyOnly writes the shutdown entry to wtmp and does not restart anything. Useful for testing
-d, --no-wtmpDoes not write the shutdown entry to wtmp
--no-wallDoes not send the warning to users before restarting
--helpShows the short help and exits

Copy-ready examples

$ sudo reboot -wonly writes the restart entry to the session log. It does not restart the machine, so it is safe to try.
$ sudo rebootrestarts now. Warning: it ends every session and does not wait for you to save your programs.
$ sudo reboot -fforces the restart without asking the system manager to stop the services. Only if the machine does not respond. Warning: risk of data loss.
$ sudo reboot --no-wallrestarts without warning users. Warning: nobody will know you are restarting.

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • reboot schedules nothing: to restart at a set time, use shutdown -r with hh:mm or +minutes.
  • It usually needs administrator rights: prefix it with sudo.
  • With -f, filesystems may not be unmounted properly, with a risk of data loss.
  • On a remote server, rebooting cuts your SSH connection: make sure first that the machine will boot on its own.

Differences from similar commands

  • shutdown: can schedule the restart with a time and warn users. reboot takes no time.
  • poweroff: powers off instead of restarting. It takes the same options as reboot.
  • halt: halts the system without cutting power, according to the systemd manual. reboot always restarts.

FAQ

Difference from shutdown -r?

reboot acts at once and takes no time. shutdown -r can schedule the restart and warn users.

What happens to my open programs?

The restart does not wait for you to confirm anything. Save your work first; with --no-wall, nobody gets a warning either.

What does the -f option do?

It skips the system manager and restarts directly, which is why the disks are not unmounted cleanly. Use it only as a last resort.

More System and processes commands

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course