Howto: Shutdown Linux System From Terminal

How do I shutdown Linux system from terminal or command line options?

The following programs allow a system administrator to shutdown the Linux server (system) from terminal (xterm or gnome-terminal or kde terminal):

ADVERTISEMENTS

[a] shutdown command – bring the system down with warning message.

[b] poweroff command or halt command – Halt / stop the system (

First, login as root user. Open a terminal window (select Applications > Accessories > Terminal). Switch to the root user by typing su – and entering the root password, when prompted. Type the following command to bring the system down immediately:
# poweroff
OR
# shutdown -h now
OR
# shutdown -h +0

Safe shutdown option

The shutdown command arranges for the system to be brought down in a safe way. All logged-in users are notified that the system is going down and, within the last five minutes of TIME, new logins are prevented. TIME may have different formats, the most common is simply the word ‘now’ which will bring the system down immediately. Other valid formats are +m, where m is the number of minutes to wait until shutting down and hh:mm which specifies the time on the 24hr clock.

In this example I’m shutting down the Linux server for disk replacement and file system recovery withing 5 minutes:
# shutdown -h +5 RAID hard-disk replacement and system recovery needed.

Shutting down remote server

To restart the remote computer or server called server1.cyberciti.biz, type:
ssh root@server1.cyberciti.biz /sbin/shutdown -h now
OR shutdown remote server in 10 minutes for hardware upgrade:
# ssh root@server1.cyberciti.biz
# shutdown -h +10 Ram upgrades.

How do I access a server after a server poweroff?

You can wakeup the remote server using the wakeonlan command or KVM over IP applications or server management interface (Remote Access Card) provided by server manufactures. See the following tutorials for more info:

  1. HowTo: Wake Up Computers Using Linux Command [ Wake-on-LAN ( WOL ) ]
  2. Remote Linux / UNIX / Windows Server Management With KVM over IP
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.