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 logged in.

Posted By: Summer Hughes     Category: Unix / Linux / Ubuntu     Views: 7017

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

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

cat /etc/passwd>user.txt
        set `wc -l user.txt`
        log=`who|wc -l`
    echo "There are $1 users in network "
    echo "There are $log user loged in rite now"    

--------------------------------------------------------------------------------

output:
    $ sh7
     There are 8 users in network
    There are 1  user loged in rite now
  
Share: 



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

Related Articles and Code:


 
Please enter your Comment

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

 
Indu Gautam from United States Comment on: Oct 08
Hi I need the code for that query
)User will input a directory ,the output should be list of all duplicate files in it.

View All Comments