Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

Shell script

  Asked By: Amit    Date: Jun 19    Category: Unix / Linux / Ubuntu    Views: 2035

(1) Write a shell script who currently loggedin to the server.



1 Answer Found

Answer #1    Answered By: Kirtiranjan Sahoo     Answered On: Aug 08


log=`who | sort -n | cut -d" " -f1 | head -1`
echo "The $log user currently logged in to your server"

Didn't find what you were looking for? Find more on Shell script Or get search suggestion and latest updates.