如何重新启动CentOS,Fedora,RedHat?

CentOS, Fedora and RedHat are Linux distributions of the same family. These distributions provides different ways and command in order to restart. In this tutorial we will look different ways to restart CentOS, Fedora and RedHat and their affect to the system.

CentOS,Fedora和RedHat是同一家族Linux发行版。 这些发行版提供了不同的方式和命令以重新启动。 在本教程中,我们将寻找重启CentOS,Fedora和RedHat及其对系统的影响的不同方法。

用关机命令重新启动 (Restart with Shutdown Command)

shutdown command is the most common way to stop or restart the system. Without providing an option shutdown will shutdown the system but will not restart. We will provide -r option in order to restart the system like below.

shutdown命令是停止或重新启动系统的最常用方法。 如果不提供选项,则关闭将关闭系统,但不会重新启动。 我们将提供-r选项以重启系统,如下所示。

$ shutdown -r

在指定时间使用关机命令重新启动 (Restart with Shutdown Command At Specified Time)

By default shutdown operation starts immediately. But we have the option to reboot at specified time in the future. We generally use minutes after to reboot. In this example we will restart the system after 5 minutes by providing +5 option.

默认情况下,关闭操作会立即开始。 但是我们可以选择在将来的指定时间重新启动。 我们通常在几分钟后重新启动。 在此示例中,我们将通过提供+5选项在5分钟后重新启动系统。

$ shutdown -r +5
Restart with Shutdown Command At Specified Time
Restart with Shutdown Command At Specified Time
在指定时间使用关机命令重新启动

使用重新启动命令重新启动(Restart with Reboot Command)

Reboot is actually not a command. reboot is a script which is alias for shutdown -r . So their affect will be the same. We can use reboot command like below. reboot also does some hard disk maintenance like sync etc.

重新启动实际上不是命令。 reboot是一个脚本,它是shutdown -r别名。 因此,它们的影响将是相同的。 我们可以使用如下所示的reboot命令。 reboot还会执行一些硬盘维护,例如同步等。

$ reboot

用停止命令重新启动 (Restart with Halt Command)

We can use halt command with --reboot option. halt command provides some log to the utmp . Most init scripts call halt for logging options. We can restart system like below with halt command.

我们可以将halt命令与--reboot选项一起使用。 halt命令向utmp提供一些日志。 大多数初始化脚本都会调用halthalt日志记录选项。 我们可以使用halt命令重启系统,如下所示。

$ halt --reboot

从初始化级别重新启动 (Restart with Init Level)

Linux uses init levels in order to specify current working mode. Level 6 is used to specify the reboot state. We can use init command in order to change Level 6 which will reboot the system. By using init related init files will be executed and invoked.

Linux使用初始化级别来指定当前的工作模式。 级别6用于指定重新引导状态。 我们可以使用init命令来更改Level 6,它将重新启动系统。 通过使用init,相关的init文件将被执行和调用。

$ init 6
LEARN MORE  How To Use "shutdown r" Command In Windows To Reboot and Shutdown Computer?
了解更多信息如何在Windows中使用“ shutdown r”命令来重新启动和关闭计算机?

翻译自: https://www.poftut.com/restart-centos-fedora-redhat/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值