Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@raulunzue
Created March 6, 2019 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raulunzue/0bd5f4aedeff250797faa920894a5a97 to your computer and use it in GitHub Desktop.
Save raulunzue/0bd5f4aedeff250797faa920894a5a97 to your computer and use it in GitHub Desktop.
# EL BLOG DE NEGU
# https://www.maquinasvirtuales.eu/script-linux-para-revisar-usuarios-conectados/
#! /bin/sh
# Descubrimos la cantidad de usuarios conectados
uconn=`who | wc -l | sed 's/^ *//g'`
# Cantidad de usuarios reales
ureal=`who | cut -f1 -d ' ' | sort -u | wc -l | sed 's/^ *//g'`
# Mostramos en pantalla todos los usuarios con el numero de veces que estan conectados
who | cut -f1 -d ' ' | uniq -c | sort | sed 's/^ *//g'
echo "connected: $uconn"
echo "reales : $ureal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment