Shutdown computer using terminal in Ubuntu

本文详细介绍了如何在Ubuntu系统中通过终端命令进行系统操作,包括关机、重启、设置定时任务等常用功能。对于不熟悉图形界面操作的用户提供了详细的指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


f you want to shutdown your computer what do you do ? Simply go to shutdown button and click shutdown isn’t?

 

Have you ever wondered how would you shutdown your pc if your gdm (Graphical User Interface) is not working. Or you are only working in command line mood or running a computer user account with ssh(secured shell) ??

 

Shutdown command

The command used in ubuntu to shutdown is shutdown.

If you want to shutdown your computer right now enter the command below

C代码 复制代码  收藏代码
  1. $ sudo shutdown -h now  
  1. $ sudo shutdown -h now  
 

or

C代码 复制代码  收藏代码
  1. $ sudo shutdown -h 0  
  1. $ sudo shutdown -h 0  
 

Shutdown computer at a scheduled time

if you want to shutdown command at a scheduled time enter the following command

C代码 复制代码  收藏代码
  1. $ sudo shutdown -h 12:00 "System is shutting down"   
  1. $ sudo shutdown -h 12:00 "System is shutting down"   
 

This will shutdown your computer on 12pm with sending this message to all user.

You can also use power off or halt command to do this.

C代码 复制代码  收藏代码
  1. $sudo halt  
  1. $sudo halt  
 

or

C代码 复制代码  收藏代码
  1. $sudo poweroff  
  1. $sudo poweroff  
 
Reboot computer

Use any of this following command

C代码 复制代码  收藏代码
  1. $ sudo reboot  
  1. $ sudo reboot  
 

or

C代码 复制代码  收藏代码
  1. $ sudo shutdown -r 0  
  1. $ sudo shutdown -r 0  
 

from: http://www.dscripts.net/2010/06/27/shutdown-computer-using-terminal-in-ubuntu/

 

解决 ubuntu 无法关机

 

1. Type in terminal:

C代码 复制代码  收藏代码
  1. sudo gedit /etc/default/grub  
  1. sudo gedit /etc/default/grub  
 

2. Find the line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"


3. Change this to: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force"


4. Save the file and close the file.

 

5. Finally, in terminal:

C代码 复制代码  收藏代码
  1. sudo update-grub  
  1. sudo update-grub  
 

 

I found it here: Dell Studio 1569 Cannot Shutdown in Ubuntu 11.10 or 12.04

 

 

Entering BIOS usually by pressing Del button when computer starting. Go to Advanced Settings and make sure APM is Enabled.

 

If you have installed Windows Operating System, and you succeed to shutdown your computer on Windows, it means your APM is Enabled.

 

If it still don’t fix your problem, try it in terminal,

C代码 复制代码  收藏代码
  1. $ sudo gedit /etc/init.d/alsa-utils  
  1. $ sudo gedit /etc/init.d/alsa-utils  
 

Change gedit with your favorite text editor. This will open alsa-utils or if it doesn’t exist, create new one.

Type,

C代码 复制代码  收藏代码
  1. ifconfig wlan0 down   
  2. ifconfig eth0 down   
  3. EXITSTATUS=0  
  1. ifconfig wlan0 down  
  2. ifconfig eth0 down  
  3. EXITSTATUS=0  
 

Save file, and try to shutdown Ubuntu.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值