这个命令会告诉上次登录和重启的相关信息

该命令将显示系统以及重新启动时的登录信息。它使用一个名为/ var / log / wtmp的文件,它捕获有关成功登录和重新启动信息的所有信息。它有很多开关,通过它你可以在人们登录他们停留多久时得到一个想法。
.

0

linux命令:last last lastrootopen.com
linux命令:last last lastrootopen.com
exfv 2018-06-10 15:11:48
输出

评论

相关推荐

last命令显示上次登录用户的列表

linux命令:last last lastrootopen.com
linux命令:last last lastrootopen.com
.

linux命令:last | awk '{ print $1 }' | sort | uniq -c | grep -v wtmp wtmp -v grep | -c uniq | sort | }' $1 print '{ awk | last last | awk '{ print $1 }' | sort | uniq -c | grep -v wtmprootopen.com
linux命令:last | awk '{ print $1 }' | sort | uniq -c | grep -v wtmp wtmp -v grep | -c uniq | sort | }' $1 print '{ awk | last last | awk '{ print $1 }' | sort | uniq -c | grep -v wtmprootopen.com
.

linux命令:last | awk '$1!~/wtmp/{logs[$1]++}END{for (i in logs) print i, logs[i]}' logs[i]}' i, print logs) in (i '$1!~/wtmp/{logs[$1]++}END{for awk | last last | awk '$1!~/wtmp/{logs[$1]++}END{for (i in logs) print i, logs[i]}'rootopen.com
linux命令:last | awk '$1!~/wtmp/{logs[$1]++}END{for (i in logs) print i, logs[i]}' logs[i]}' i, print logs) in (i '$1!~/wtmp/{logs[$1]++}END{for awk | last last | awk '$1!~/wtmp/{logs[$1]++}END{for (i in logs) print i, logs[i]}'rootopen.com
.

该命令接收'last'命令的输出,删除空行,获取第一个字段($ USERNAME),按相反顺序对$ USERNAMES进行排序,然后给出唯一匹配的汇总计数。

linux命令:last | grep -v "^$" | awk '{ print $1 }' | sort -nr | uniq -c -c uniq | -nr sort | }' $1 print '{ awk | "^$" -v grep | last last | grep -v "^$" | awk '{ print $1 }' | sort -nr | uniq -crootopen.com
linux命令:last | grep -v "^$" | awk '{ print $1 }' | sort -nr | uniq -c -c uniq | -nr sort | }' $1 print '{ awk | "^$" -v grep | last last | grep -v "^$" | awk '{ print $1 }' | sort -nr | uniq -crootopen.com
.

linux命令:last reboot reboot last last rebootrootopen.com
linux命令:last reboot reboot last last rebootrootopen.com
.

根据你想知道的会话数量来改变20(20它够公平的)

linux命令:last -n 20 20 -n last last -n 20rootopen.com
linux命令:last -n 20 20 -n last last -n 20rootopen.com
.

linux命令:last reboot reboot last last rebootrootopen.com
linux命令:last reboot reboot last last rebootrootopen.com
.

在目录中显示单个最近修改的文件

linux命令:lastfile () { find ${1:-.} -maxdepth 1 -type f -printf "%T+ %p\n" | sort -n | tail -n1 | sed 's/[^[:space:]]\+ //'; } } //'; 's/[^[:space:]]\+ sed | -n1 tail | -n sort | %p\n" "%T+ -printf f -type 1 -maxdepth ${1:-.} find { () lastfile lastfile () { find ${1:-.} -maxdepth 1 -type f -printf "%T+ %p\n" | sort -n | tail -n1 | sed 's/[^[:space:]]\+ //'; }rootopen.com
linux命令:lastfile () { find ${1:-.} -maxdepth 1 -type f -printf "%T+ %p\n" | sort -n | tail -n1 | sed 's/[^[:space:]]\+ //'; } } //'; 's/[^[:space:]]\+ sed | -n1 tail | -n sort | %p\n" "%T+ -printf f -type 1 -maxdepth ${1:-.} find { () lastfile lastfile () { find ${1:-.} -maxdepth 1 -type f -printf "%T+ %p\n" | sort -n | tail -n1 | sed 's/[^[:space:]]\+ //'; }rootopen.com
.

获取最后一次服务器重启的时间和日期

linux命令:last reboot reboot last last rebootrootopen.com
linux命令:last reboot reboot last last rebootrootopen.com
.

- 更短 - 更具可读性

linux命令:last reboot reboot last last rebootrootopen.com
linux命令:last reboot reboot last last rebootrootopen.com
.

显示服务器上登录的历史记录

linux命令:last last lastrootopen.com
linux命令:last last lastrootopen.com
.

输出服务器上的登录历史记录(排在前10位) 可选标志: '-a'将主机名放在行尾(适用于长主机名), '-i'放置IP而不是主机名, '-F'放置完整的登录和注销时间,而不是短时间

linux命令:last -aiF | head head | -aiF last last -aiF | headrootopen.com
linux命令:last -aiF | head head | -aiF last last -aiF | headrootopen.com
.

将-n添加到最后一个命令以限制为最后的num登录,否则它将提取所有可用的历史记录。

linux命令:last|grep `whoami`|grep -v logged|cut -c61-71|sed -e 's/[()]//g'|awk '{ sub("\\+", ":");split($1,a,":");if(a[3]){print a[1]*60*60+a[2]*60+a[3]} else {print a[1]*60+a[2] }; }'|paste -s -d+ -|bc|awk '{printf "%dh:%dm:%ds\n",$1/(60*60),$1%(60*60)/60,$1%60}' "%dh:%dm:%ds\n",$1/(60*60),$1%(60*60)/60,$1%60}' '{printf -|bc|awk -d+ -s }'|paste }; a[1]*60+a[2] {print else a[1]*60*60+a[2]*60+a[3]} ":");split($1,a,":");if(a[3]){print sub("\\+", '{ 's/[()]//g'|awk -e -c61-71|sed logged|cut -v `whoami`|grep last|grep last|grep `whoami`|grep -v logged|cut -c61-71|sed -e 's/[()]//g'|awk '{ sub("\\+", ":");split($1,a,":");if(a[3]){print a[1]*60*60+a[2]*60+a[3]} else {print a[1]*60+a[2] }; }'|paste -s -d+ -|bc|awk '{printf "%dh:%dm:%ds\n",$1/(60*60),$1%(60*60)/60,$1%60}'rootopen.com
linux命令:last|grep `whoami`|grep -v logged|cut -c61-71|sed -e 's/[()]//g'|awk '{ sub("\\+", ":");split($1,a,":");if(a[3]){print a[1]*60*60+a[2]*60+a[3]} else {print a[1]*60+a[2] }; }'|paste -s -d+ -|bc|awk '{printf "%dh:%dm:%ds\n",$1/(60*60),$1%(60*60)/60,$1%60}' "%dh:%dm:%ds\n",$1/(60*60),$1%(60*60)/60,$1%60}' '{printf -|bc|awk -d+ -s }'|paste }; a[1]*60+a[2] {print else a[1]*60*60+a[2]*60+a[3]} ":");split($1,a,":");if(a[3]){print sub("\\+", '{ 's/[()]//g'|awk -e -c61-71|sed logged|cut -v `whoami`|grep last|grep last|grep `whoami`|grep -v logged|cut -c61-71|sed -e 's/[()]//g'|awk '{ sub("\\+", ":");split($1,a,":");if(a[3]){print a[1]*60*60+a[2]*60+a[3]} else {print a[1]*60+a[2] }; }'|paste -s -d+ -|bc|awk '{printf "%dh:%dm:%ds\n",$1/(60*60),$1%(60*60)/60,$1%60}'rootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令