Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Write a shell scripts that finds total no. of users and finds out how many of them are currently loggedin

Posted By: Sara Hughes     Category: Unix / Linux / Ubuntu     Views: 4766

Write a shell scripts that finds total no. of users and finds out how many of them are currently loggedin

Code for Write a shell scripts that finds total no. of users and finds out how many of them are currently loggedin in Unix / Linux / Ubuntu

total=`cat /etc/passwd | wc -l`
cur_log=`who | wc -l`

echo "Total users      : $total"
echo "Currently logged : $cur_log"
  
Share: 



Sara Hughes
Sara Hughes author of Write a shell scripts that finds total no. of users and finds out how many of them are currently loggedin is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 

Other Interesting Articles in Unix / Linux / Ubuntu:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!