How do I get average CPU, memory,.. from within shell script

I have created a shell script that starts the server then uploads a 1GB file using FTP… but how do I get the average CPU used in this whole process

You can try creating a parallel script that will monitor the CPU while the first one triggers the transfers.
Google for getting average CPU for a process on Linux.

1 Like

@Kiran

I have found few articles on the web about getting the average values of cpu and memmory for a process but i am always getting 0 for every parameter

Is there a way to get average…

or do i need to take values say every 5 seconds through a parallel script and take average from the values

Sure, you can do that.