subject

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.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:40
Hello my name is mihai and i need your : )i have to do a python project in computer science and i’m really busy with my mocks this period of time besides this i’m not good at coding so could someone pls pls pls sort me out ? i actually beg ; ))
Answers: 1
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
question
Computers and Technology, 23.06.2019 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
Answers: 1
question
Computers and Technology, 23.06.2019 06:10
The head restraint should be adjusted so that it reaches a.the top of your ears b.the base of your skull c.the top of the head
Answers: 1
You know the right answer?
Write a bash shell script named user_details. sh that takes no arguments. the script should identify...
Questions
question
Mathematics, 21.10.2020 02:01
question
Mathematics, 21.10.2020 02:01
question
Mathematics, 21.10.2020 02:01
question
Computers and Technology, 21.10.2020 02:01
question
Mathematics, 21.10.2020 02:01
question
Biology, 21.10.2020 02:01
question
Mathematics, 21.10.2020 02:01
Questions on the website: 13722361