By using “last” command without an option, the login time period is displayed as
ID: 3817083 • Letter: B
Question
By using “last” command without an option, the login time period is displayed as follow:
$ last | grep "Oct 20" | head -2
cfs264fa pts/3 c-68-46-14-229.h Tue Oct 20 23:24 - 23:47 (00:22)
cfs264fa pts/0 c-68-46-14-229.h Tue Oct 20 22:51 - 23:24 (00:33)
Please find a proper option, using “man last,” so that the full login date/time information can be displayed as
follow:
$ last __________ | grep "Oct 20" | head -2
cfs264fa pts/3 c-68-46-14-229.h Tue Oct 20 23:24:36 2015 - Tue Oct 20 23:47:28 2015 (00:22)
cfs264fa pts/0 c-68-46-14-229.h Tue Oct 20 22:51:11 2015 - Tue Oct 20 23:24:38 2015 (00:33)
Explanation / Answer
$ last -t | grep "Oct 20" | head -2
The last -t which is used to display the full login with year month date hours minutes and seconds. The grep command which is used to display a particular string line in a file and the head command which is used to display the top lines of output.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.