Show users logged in

Active user sessions and what they are running

who -H && w

tool
linux133 commands
tags
linuxsecurity

More linux commands

  • last -n 20 | head -25

    Last 20 login records with IP and duration

  • journalctl -u ssh --since '24h ago' | grep 'Failed password' | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -10

    Top source IPs of failed SSH logins in last 24h

  • sudo -l -U <username>

    List sudo rules for a specific user

  • usermod -aG docker,sudo alice

    Append user to multiple groups without removing existing ones

  • cat /proc/<pid>/smaps | awk '/^Size/{sum+=$2} END{print sum/1024" MB"}'

    Total virtual memory size of a process from smaps

all 133 linux commands