ps -p <pid> -o %cpu,%mem,cmd
(You can leave off “cmd” but that might be helpful in debugging).
Note that this gives average CPU usage of the process over the time it has been running.
More Related Contents:
- How do I prompt for Yes/No/Cancel input in a Linux shell script?
- Environment variable substitution in sed
- ./configure : /bin/sh^M : bad interpreter [duplicate]
- What does “&” at the end of a linux command mean?
- The ‘eval’ command in Bash and its typical uses
- How to parse XML using shellscript? [duplicate]
- How to join multiple lines of file names into one with custom delimiter?
- Is there a way to ‘uniq’ by column?
- Linux: copy and create destination dir if it does not exist
- How to determine whether a given Linux is 32 bit or 64 bit?
- Why is a tilde in a path not expanded in a shell script?
- Get program execution time in the shell
- Edit shell script while it’s running
- How to Free Inode Usage?
- Linux bash: Multiple variable assignment
- How to sort a file in-place?
- Run a shell command when a file is added
- How to substitute shell variables in complex text files
- Is it OK to use the same input file as output of a piped command?
- When to wrap quotes around a shell variable?
- How to get file creation date/time in Bash/Debian?
- How do I remove newlines from a text file?
- How to join multiple lines of filenames into one with custom delimiter
- What is the difference between “./somescript.sh” and “. ./somescript.sh”
- Recursive search and replace in text files on Mac and Linux
- Counter increment in Bash loop not working
- Replace whitespace with a comma in a text file in Linux
- Syntax error near unexpected token ‘then’
- Check for IP validity
- Why doesn’t “sort file1 > file1” work?