Added "shutdown -r" as common command (#21070)

This commit is contained in:
mcnorton05
2018-10-24 01:48:13 -04:00
committed by Eric Leung
parent 36a64de3e0
commit d388d7f7ef

View File

@ -15,7 +15,7 @@ Example 2: `echo "Hello world" > hello.txt`
1. `cut` When you have a string with separators in it, use `cut` to filter out certain fields. Example: `echo "this, that, and the other" | cut -d, -f2 # "that"` 1. `cut` When you have a string with separators in it, use `cut` to filter out certain fields. Example: `echo "this, that, and the other" | cut -d, -f2 # "that"`
1. `grep` To find lines of text that contain a certain string, use grep. Example: `grep 'root' /etc/passwd # root:x:0:0:root:/root:/bin/bash` 1. `grep` To find lines of text that contain a certain string, use grep. Example: `grep 'root' /etc/passwd # root:x:0:0:root:/root:/bin/bash`
1. `sed` Use sed to find and change a substring in a piece of text. Example: `echo "this, that, and the other" | sed 's/that/those/' # "this, those, and the other"` 1. `sed` Use sed to find and change a substring in a piece of text. Example: `echo "this, that, and the other" | sed 's/that/those/' # "this, those, and the other"`
1. `shutdown` use shut down the system and turn off the power. Example: `shutdown -h now`shuts down system immediately. `shutdown -h +5` shuts down system after five minutes. 1. `shutdown` use shut down the system and turn off the power. Example: `shutdown -h now`shuts down system immediately. `shutdown -h +5` shuts down system after five minutes. Alternatively, `shutdown -r` will initate a reboot.
Use these commands in scripts and at the command line. They're all very powerful commands, and Linux's man page has a lot more information about each one. Use these commands in scripts and at the command line. They're all very powerful commands, and Linux's man page has a lot more information about each one.