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 [...]

Options Description
w -h This option don’t print the header.
w -u This option will ignore the username while figuring out the current process and cpu times.
w -s This option uses the short format. It will not print the login time, JCPU or PCPU times.
w -f This 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 -help This option will display help message and exit.
w -i This option will display IP address instead of hostname for from field.
w -V This option will display version information.
w -o This option will print blank space for idle times less than one minute.
w user This 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]

Options Description
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 -H To 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 -H To show status of the users message as +, – or ?
who -u To show list of users logged in to system
who -b -H To show time of the system when it booted last time
who -d -H To show details of all dead processes
who -l -H To show system login process details
who -q -H To count number of users logged on to system
who -r To display current run level of the system
who -a To display all details of current logged in user
whoami  To display system’s username
w To display list of users and their activities
id To 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

...