Ondra Pala
Ondra Pala

Reputation: 59

Linux - display memory of some command

I want to display memory (RAM) of some commmand in Linux. For example, I write to command line this command - for run Python script:

python 'someScript.py'

I want to display how much memory this command (process) uses.

Upvotes: 1

Views: 84

Answers (3)

PepperoniPizza
PepperoniPizza

Reputation: 9102

ps aux | grep "myscrip_name" | awk '{print $4}'

To display the % of memory being used by the running process myscript_name. Obviously can get the memory used when you know the % used.

Upvotes: 1

Dinushan
Dinushan

Reputation: 2077

You can use 'time' command

/usr/bin/time -v python 'someScript.py'

note that this is not a built-in shell command

Upvotes: 2

Sara Santana
Sara Santana

Reputation: 1019

there are many commands that you can use:

proc/meminfo
top
htop

among this command I think top is suitable for you, top clearly highlights which processes are consuming the most CPU cycles and memory

Upvotes: 1

Related Questions