Question

Unix Help - I cant figure out how to answer the last question. Please help! Write...

Unix Help - I cant figure out how to answer the last question. Please help!

Write a bash script to produce the answers to each of the questions below. Before the output, echo to the screen the question number and the command that will be executed.

Show a real-time view of system information, such as CPU usage, memory usage, etc., and the processes using the most CPU, memory and time.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

for the question you posted you are only asking for the last question that is how to show the real time view of system information,etc. so i will try to answer only that with all my knowledge.

As a Linux user, you may need to need to know some basic details of your Linux system, like currently running processes, average system load, cpu and memory usage etc., at some point. for this , we have a command line utility called “top” to get such details.

The top command is a well-known and most widely used utility to display dynamic real-time information about running processes in Unix-like operating systems. In this brief tutorial, we are going to see some Top command examples on Linux.

To start monitoring the running processes, simply run the top command without any options:

$ top

now you will see some output in the form of tables and attributes.

the top command displays the list of processes in multiple columns. each column displays details such as pid, user, cpu usage, memory usage. Apart from the list of processes, you will also see the brief stats about average system load, number of tasks, cpu usage, memory usage and swap usage on the top.

I will explain the attributes which will come up when you will execute the top command.

  • PID – Process id of the task.
  • USER – Username of the the task’s owner.
  • PR – Priority of the task.
  • NI – Nice value of the task. If the nice value is negative, the process gets higher priority. If the nice value is positive, the priority is low. Refer this guide to know more about nice.
  • VIRT – Total amount of virtual memory used by the task.
  • RES – Resident Memory Size, the non-swapped physical memory a task is currently using.
  • SHR – Shared Memory Size. The amount of shared memory used by a task.
  • S – The status of the process (S=sleep R=running Z=zombie).
  • %CPU – CPU usage. The task’s share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time.
  • %MEM – Memory Usage. A task’s currently resident share of available physical memory.
  • TIME+ – Total CPU time used by the task since it has started, precise to the hundredths of a second.
  • COMMAND – Name of the running program.

Hope you got clear !

Thank you !

Add a comment
Know the answer?
Add Answer to:
Unix Help - I cant figure out how to answer the last question. Please help! Write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • UNIX help!!!! I need what the text would look like in the vi editor. also note...

    UNIX help!!!! I need what the text would look like in the vi editor. also note this question has been posted before and the answers were all wrong!! Write a shell script (bash or sh) that prints out the following lines/information: Only your name may be hard coded, the rest must be obtained programmatically within the shell script. Name: "Your name" Hostname: "The computer's hostname" Host IP: "The computer's IP number" Default Gateway: "The computer's default gateway" OS Version: "Whatever...

  • Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell...

    Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell variables, and .profile script file, echo SHELL, HOME, PATH, MAIL and TERM are predefined shell variables. You can use the value of a shell variable in a shell command putting $ in front of it. For example, to display the value of the HOME directory of the user, specify $HOME in the echo command like echo $HOME. Do not give just the value of...

  • Hello all, I have a c++/unix (bash) question. I am struggling on starting this assignment. If...

    Hello all, I have a c++/unix (bash) question. I am struggling on starting this assignment. If you could start the assignment and tell me how to do the rest it would be greatly appreciated! (Quick thumbs up answer response if thorough and correct) Maintain automobile records in a database Write a shell script to create, view and modify a simple database that contains automobile records. The shell script has to be done in Bourne shell syntax (bash as a matter...

  • I need this done ASAP. Please write a bash shell script that does the following: Prints...

    I need this done ASAP. Please write a bash shell script that does the following: Prints out how many users are logged on. This can be accomplished using who and wc. Prints out a list of currently logged on users. This can be accomplished using who, grep, regular expressions, and echo. Prints out how many processes you have running from past days, and a list of those jobs. Use `whoami` to get your username. Run ps -ef and see how...

  • HELP with last part!! Cant figure it out!! (a) Find the electric potential at points a...

    HELP with last part!! Cant figure it out!! (a) Find the electric potential at points a and b for charges of +3.5 nC and -5.2 nC located as shown in the figure. (b) What is the potential difference N for a trip from a to b? (c) How much work must be done by an external agent to move a point charge of +2.50 nC fron a to b? 11.0 cm 11.0 cnm 15.0 cm dl 11.0 cm -5.0 cm...

  • Nodal Analysis Please Help!! I cant get the correct answer. I cant figure out what I'm...

    Nodal Analysis Please Help!! I cant get the correct answer. I cant figure out what I'm doing wrong ξ2 κα Οεον 5 k2 100V Given: The circuit shown above. Required: Calculate the node voltages, V, and V2. Solution: Vi= v V2- v Submit these values If you are not ready to submit the answers now, you can print this work it off-line, then log in again to submit the answers. As long as you log in under the same user...

  • Question 2 0/1 point (graded) What happens when you remove a directory using the command rm...

    Question 2 0/1 point (graded) What happens when you remove a directory using the command rm -r? You cannot remove a directory using the rm command. You permanently remove the entire directory, including all files and subdirectories. You move the entire directory to a trash folder, but it can be restored later. You get a warning message asking if you want to proceed, then you delete the directory. incorrect Answer Incorrect: Try again. Unix does not warn you before permanently...

  • This is for a Unix class. Please help me out. I am attaching a skeletal code of the program below, it just needs ti be filled in. Below is a skeletal code of the program. Fork a child process...

    This is for a Unix class. Please help me out. I am attaching a skeletal code of the program below, it just needs ti be filled in. Below is a skeletal code of the program. Fork a child process and then use the parent for reading and the child for writing.  This is just a way of sending and receiving messages asynchronously. /* ************************************************************* * Utility functions * ************************************************************** */ static void usageError(const char * progName, const char *msg) {...

  • This is a very interesting problem that i cant figure out. please answer the question clearly...

    This is a very interesting problem that i cant figure out. please answer the question clearly and show all work. Thanks! A voltage source, in the circuit shown below, is short-circuited at its terminals by closing switch Si. At the time the switch is closed, the circuit has been in operation for a long time. Circuit values. Vs- 480 V Rs-1 S RI 10 ? R2 15? L1-2 mH L2-12 mH a) Find the initial value of the current through...

  • Question 1: 1. Figure out what the following MATLAB code does (Notice that R n =...

    Question 1: 1. Figure out what the following MATLAB code does (Notice that R n = 500 for jay - 1:4 ifjoy > 1;oldtime = time; end M rand(n); t cputime; forrep -1:5 R chol(A): en time = cputime-t; if jay > 1; ratio - time/oldtime, end en If you put these instructions into a file named, say, zap.m, you can run the program by typing zap from the MATLAB command line. The functions randn, cputime, and chol are built-in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT