Finance[US] Career Guide Free Tutorials Go to Your University Placement Preparation 
0 like 0 dislike
886 views
in RGPV/UTMP B.Tech (CSE-V Sem) Linux LAB by Goeduhub's Expert (7.6k points)
Write a pipeline of commands, which displays on the monitor as well as saves the information about the number of users using the system at present

1 Answer

0 like 0 dislike
by Goeduhub's Expert (7.6k points)
edited by
 
Best answer

Write a pipeline of commands, which displays on the monitor as well as saves the information about the number of users using the system at present

w command 

Shows information about the users currently on the machine, and their processes.w command in Linux is used to show who is logged on and what they are doing. This command shows the information about the users currently on the machine and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. 

Syntax:w [options] user [...]

OptionsDescription
w -hThis option don’t print the header.
w -uThis option will ignore the username while figuring out the current process and cpu times.
w -sThis option uses the short format. It will not print the login time, JCPU or PCPU times.
w -fThis option will toggle printing the from (remote hostname) field. The default as released is from field which not be printed. Although your system administrator or your distribution maintainer may have compiled a version in which the from field is shown by default.
w -helpThis option will display help message and exit.
w -iThis option will display IP address instead of hostname for from field.
w -VThis option will display version information.
w -oThis option will print blank space for idle times less than one minute.
w userThis option will show information about the specified user only.
 

Example 

w and who

w options

who command 

who command is used to find out the following information :

1. Time of last system boot
2. Current run level of the system
3. List of logged in users and more.

The who command is used to get information about currently logged in user on to system.

Syntax : who [options] [filename]

OptionsDescription
who

The who command displays the following information for each user currently logged in to the system if no option is provided :

  1. Login name of the users
  2. Terminal line numbers
  3. Login time of the users in to system
  4. Remote host name of the user
who -m -HTo display host name and user associated with standard input such as keyboard
who -p -H To show all active processes which are spawned by INIT process
who -T -HTo show status of the users message as +, – or ?
who -uTo show list of users logged in to system
who -b -HTo show time of the system when it booted last time
who -d -HTo show details of all dead processes
who -l -HTo show system login process details
who -q -HTo count number of users logged on to system
who -rTo display current run level of the system
who -aTo display all details of current logged in user
whoami To display system’s username
wTo display list of users and their activities
idTo display user identification information

Example

who options


For more  RGPV/UTMP CSE-V Sem Linux LAB Experiments Click Here


Learn & Improve In-Demand Data Skills Online in this Summer With  These High Quality Courses[Recommended by GOEDUHUB]:-

Best Data Science Online Courses[Lists] on:-

Claim your 10 Days FREE Trial for Pluralsight.

Best Data Science Courses on Datacamp
Best Data Science Courses on Coursera
Best Data Science Courses on Udemy
Best Data Science Courses on Pluralsight
Best Data Science Courses & Microdegrees on Udacity
Best Artificial Intelligence[AI] Courses on Coursera
Best Machine Learning[ML] Courses on Coursera
Best Python Programming Courses on Coursera
Best Artificial Intelligence[AI] Courses on Udemy
Best Python Programming Courses on Udemy

Related questions

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy ||  Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 

 

Free Online Directory

...