linux man

不知为什么 近来好多学PHP 的JAVA的朋友呀 同事呀 老是问怎么学习linux 怎么你们linux 命令那么多 ,你们记得么
PS:这文章是给老是问linux的非linux从业者者准备的,那些linux大牛请绕道吧 哈哈
很多命令 当然是记不住的啦 或者说有个印象就好了 其实我从来没有用心去记过,如果一定要问为什么,我只能说哥记忆不好,就像 高中学历史一样 ,班主老是叫我去背后面的大题,但是我老是觉得背的没意思 就像八股文,多没意思 ,于是,大题按自己的思路,想怎么就怎么写,答题起来是很爽 ,可惜结果是 一般是选择题全对,后面大题对一半 ,这个是悲剧,所以必要的记忆是少不了的, 好在linux其实可以避免上面的悲剧 ,那就是man 当然 这个不是男人的意思呀 而应该是 manpages 就像cat 也和喵星人没有半毛钱关系,请看客不要在后面问cat 是什么 , 如果我讲wc 那你会怎么想呢
唠叨的话到此完, 想用一下定时关机,就借此机会说说
下面开始正题 关机有很多命令但是定时关机的 一般用shutdown 这个就是必要的记忆了,你只要记得这个命令就好了,不知道怎么用,没问题 下面来man 一下
man shutdown [enter]
NAME
shutdown – Halt, power-off or reboot the machine
SYNOPSIS
shutdown [OPTIONS…] [TIME] [WALL…]
DESCRIPTION
shutdown may be used to halt, power-off or reboot the
machine.
The first argument may be a time string (which is usually
“now”). Optionally, this may be followed by a wall
message to be sent to all logged-in users before going
down.
The time string may either be in the format “hh:mm” for
hour/minutes specifying the time to execute the shutdown
at, specified in 24h clock format. Alternatively it may
be in the syntax “+m” referring to the specified number
of minutes m from now. “now” is an alias for “+0”, i.e.
for triggering an immediate shutdown. If no time argument
is specified, “+1” is implied.
Note that to specify a wall message you must specify a
time argument, too.
If the time argument is used, 5 minutes before the system
goes down the /run/nologin file is created to ensure that
further logins shall not be allowed.
OPTIONS
The following options are understood:
–help
Print a short help text and exit.
-H, –halt
Halt the machine.
-P, –poweroff
Power-off the machine (the default).
-r, –reboot
Reboot the machine.
-h
Equivalent to –poweroff, unless –halt is specified
没错,都是英文 一般都是英文,不要说英文看不懂 我也是英文很差的人
首先 在SYNOPSIS 看shutdown格式
然后 OPTIONS 看要哪个参数 我们这里用 -h ,然后是时间DESCRIPTION那里可见 我们100分种后关机 就是+100
于是100分钟后定时关机的命令如下
root@evankali:~# shutdown -h +100
Shutdown scheduled for 一 2015-11-16 00:18:24 CST, use ‘shutdown -c’ to cancel.