Linux learning (5) - shutdown and restart commands

table of Contents

shutdown command

Other shutdown command

Other restart command

System run level

Log command


 

Video tutorial lesson but learning Mu: https://www.imooc.com/video/4374

This section summarizes the study and made notes.

 

shutdown command

grammar:

shutdown [选项] 时间
	选项:
		-c 取消前一个关机命令
		-h 关机
		-r 重启

Now shutdown input: shutdown -h now

Use the date command to view the current date.

On the server remote shutdown should be avoided.

Press Ctrl + C to exit.

Example 1: shutdown -r 02:59 command , at 02:59 will reboot the Linux system. The virtual machine itself time and computer time may be different.

You need to login again

 

Other shutdown command

  • halt

  • poweroff

  • init 0

 

Other restart command

  • reboot

  • init 6

 

System run level

  • 0 for shutdown

  • 1 represents a single user

  • 2 represents an incomplete multi-user, without NFS service

  • 3 full multiuser

  • 4 Unallocated

  • 5 GUI

  • 6 Restart

You can perform system-level run by "init 6" command.

You can not write 0 or 6, or a boot will shutdown or reboot, you can write 3 or 5 character interface graphical interface.

cat /etc/inittab
	修改系统默认运行级别。id:3:initdefault:
runlevel
	查询系统运行级别

 

Log command

logout
	退出登录

 

Published 500 original articles · won praise 77 · views 160 000 +

Guess you like

Origin blog.csdn.net/cnds123321/article/details/104953882