Created
March 6, 2019 09:40
-
-
Save raulunzue/0bd5f4aedeff250797faa920894a5a97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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