whoami [option]
The whoami
command allows Linux users to see the currently logged-in user. The output displays the username of the effective user in the current shell. Additionally, whoami
is useful in bash scripting to show who is running the script
Example:
$ whoami
mimigonz
last [options] [username...] [tty...]
Displays information about the last logged-in users,. It will, by default, take the system log file /var/log/wtmp
as the data source to generate reports
The lastb command is the same as the last command, except that, by default, it searches through the /var/log/btmp file, which contains all the bad login attempts
Example:
$ last -n 7
mimigonz pts/0 172.16.0.4 Wed Sep 7 18:35 still logged in
secscan pts/0 10.1.6.135 Wed Sep 7 10:25 - 10:25 (00:00)
secscan pts/0 10.1.6.135 Wed Sep 7 10:19 - 10:19 (00:00)
secscan pts/0 10.1.6.135 Wed Sep 7 10:15 - 10:16 (00:00)
secscan pts/0 10.1.6.135 Wed Sep 7 10:15 - 10:15 (00:00)
mimigonz pts/0 172.16.0.4 Tue Sep 6 21:02 - 23:19 (02:17)
nbawa pts/0 172.16.0.4 Tue Aug 16 14:01 - 14:01 (00:00)