63.Linux: shutdown and restart, login and logout

table of Contents

One, shutdown and restart

2. User login and logout

1. Ordinary users switch administrator status

2. User logout


One, shutdown and restart

Shut down immediately:

shutdown -h now

Shut down after one minute:

shutdown -h 1

Restart the computer:

shutdown -r now

Shut down:

halt

Restart the computer:

reboot

Synchronize the data in the memory to the disk:

sync

Note: Regardless of whether it is restarting or shutting down, it is recommended to run the sync command before executing these commands to write the data in the memory to the disk

 

We open the terminal, enter the shutdown above, and see the effect:

After pressing enter:

 

2. User login and logout

1. Ordinary users switch administrator status

su - root

2. User logout

Enter logout at the prompt

Note: The logout command is invalid in the graphical interface. Effective in run level 3

 

Guess you like

Origin blog.csdn.net/qq_40594696/article/details/112561403