1.查看最近一次启动时间
who -b
system boot 2014-07-27 18:48
2.who命令实现带有“表头”的查询结果
who -H
NAME LINE TIME COMMENT
root pts/1 2017-10-19 09:29 (22.113.28.213)
root pts/2 2017-10-19 15:16 (117.132.10.124)
3.通过who命令来查看运行级别
who -r
run-level 3 2017-07-27 18:48
4.who命令查看带有消息状态标志的结果(+:表示可接受消息;-:表示禁止接收消息)
who -T
root + pts/1 2017-10-19 09:29 (22.112.24.213)
root + pts/2 2017-10-19 15:16 (111.121.10.194)
5.通过who命令查看服务器登录记录
last -f /var/log/wtmp
6.查看当前终端是否允许被访问
mesg
is y
7.禁止当前终端被访问
mesg n
8.通过write命令实现终端间的交互
#lisi pts/2
write zhagnsan pts/3
hello,what are u doing
这时张三所在终端会显示
Message from lisi@localhost on pts/2 at 15:55 ...
hello,what are u doing
注意:接收方想重新回到cli,enter即可。crtl+d即可结束会话。
9.下载网页保存到文件并记录日志
wget -o quote.log -O Daily_Quote.html $url
-o 记录日志
-O 自定义文件名
10.检测一个网址是否有效
wget --spider www.baidu.com
Spider mode enabled. Check if remote file exists.
--2017-10-19 17:50:01-- http://www.baidu.com/
Resolving www.baidu.com... 115.239.211.112, 115.239.210.27
Connecting to www.baidu.com|115.239.211.112|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 277 [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.
更为简洁的方式:
wget -nv --spider www.baidu.com
2017-10-19 17:53:32 URL: http://www.baidu.com/ 200 OK
及时行乐