Computers and Technology

Write a bash shell script named user_details. sh that takes no arguments. the script should identify all currently active user on the system. for each of those users, the script should identify their full name (if one is present), the absolute path of their home directory, the total number of all files in their home directory (including files in subdirectories)(do not count directories as files for this case), the current number of processes owned by the user, and the top seven (7) processes by memory usage. example output of this script is as follows:
thor@muninn ~]$ user_details. sh

user: thor odinson (thor)
logged in: 2019-12-05 14: 27
home directory is /home/thor/
home directory contains 437 files and directories
thor has 84 processes
top 7 processes sorted by memory usage:

pid user ni virt res shr s %cpu %mem time+ command

8934 thor 0 2732664 283392 41524 s 0.0 15.1 1: 50.57 firefox
18590 thor 0 3159188 275080 13456 s 0.0 14.6 8: 29.25 gnome-shell
9253 thor 0 1889768 161468 6212 s 0.0 8.6 0: 03.92 wireshark
18950 thor 0 1109908 71160 4780 s 0.0 3.8 0: 05.89 gnome-software
3855 thor 0 681216 20840 9428 s 0.0 1.1 0: 08.15 gnome-terminal
10526 thor 0 1011968 20276 2564 s 0.0 1.1 0: 13.30 nautilus
10233 thor 0 1701720 20232 880 s 0.0 1.1 0: 00.41 dhcpd

user: odin allfather (odin)
logged in: 2017-01-01 04: 20
home directory is /home/odin/
home directory contains 6539 files and directories
odin has 609 processes

top 7 processes sorted by memory usage:

pid user ni virt res shr s %cpu %mem time+ command

4 odin 0 2732664 283392 41524 s 0.0 11.1 91: 50.57 firefox
590 odin 0 3159188 275080 13456 s 0.0 4.6 28: 29.25 gnome-shell
950 odin 0 1109908 71160 4780 s 0.0 3.8 10: 05.89 gnome-software
55 odin 0 681216 20840 9428 s 0.0 1.1 10: 08.15 gnome-terminal
28 odin 0 1701720 20232 880 s 0.0 1.1 05: 00.41 dhcpd

you should then provide the full details required to execute this script every 15 minutes. provide the full code of the script below on a new page. the font must be formatted as courier, 11pt font. you may receive up to an additional 5 points for providing a screenshot of the script working as required.

note: the process columns must be listed in the order shown
hint: think about which files & commands are needed for each individual component of the output.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, darrengresham999
Choose the best explanation for the following statement communication is symbolic
Answers: 3
image
Computers and Technology, 22.06.2019 23:30, kenken2583
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
image
Computers and Technology, 23.06.2019 14:30, soapai
Select the correct answer. sean is a computer programmer. he has programmed an application for toddlers that plays nursery rhymes. however, a logic error has occurred in the program. which problem is a likely consequence of the error? a. the program crashes every time the user wants to play the nursery rhymes. b. the program crosses its buffer boundaries and overwrites an adjacent program. c. the program plays a different nursery rhyme than the one the user intended to play. d. the program shows different structures in its programming language code. e. the program introduces new viruses every time the user plays a nursery rhyme.
Answers: 1
image
Computers and Technology, 23.06.2019 17:30, granta1
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
Do you know the correct answer?
Write a bash shell script named user_details. sh that takes no arguments. the script should identify...

Questions in other subjects: