圖一是Linux的登入Log現在要去掉有reboot的那行,如下圖二只顯示USER(giving )登入時間。但是小弟一直找不到對應的regex語法,有大大知道regex語法語法要怎下嗎?
PS: 這個需求就是列出登入者同時不要顯示Reboot(重開機)
圖一
# last | head -n 5
giving pts/0 :0 Tue Mar 14 10:56 still logged in
giving :0 :0 Tue Mar 14 10:55 still logged in
reboot system boot 3.10.0-1160.25.1 Tue Mar 14 10:43 - 15:42 (04:58)
giving :0 :0 Tue Mar 14 10:11 - down (00:32)
reboot system boot 3.10.0-1160.25.1 Fri Apr 1 11:49 - 10:43 (346+22:54)
圖二
# last | grep -v reboot | head -n 3
giving pts/0 :0 Tue Mar 14 10:56 still logged in
giving :0 :0 Tue Mar 14 10:55 still logged in
giving :0 :0 Tue Mar 14 10:11 - down (00:32)