See who's logged in to your Linux/Unix box:
Go to the terminal and type
$ w (or who)
at the prompt followed by enter - then you will get a list of active users and the last used IP address when they were logged in.
If you want to know who has been logged in sometime in the past, you can use 'last' in the terminal.
$ last -s "-3 weeks"
will give you an overview of users who have been logged in for the past 3 weeks.
You can always look in the man(ual) to see what other options you have with a command.
$ man who
Avoid typing too much with "history" :)
$ history
will give you a summary of the most recently executed commands. You can then choose to pip the output on to 'less' to get a scrollable overview or 'grep' to search more in-depth.
$ history | grep -i "ssh"
gives you an overview of used ssh commands and their arguments.
Did you notice the number to the left of the command? You can use the number to run a command again! That's a nifty way of avoiding having to either type in the command again or keep bashing Page Up until you discover the command wanted again ;).
Say you want to rerun the command at entry 1115... Just type:
!1115
One final trick: If you type double exclamation marks !!
, the system will rerun the last command, you entered.
Cheers!
Top comments (0)