Cheatsheet: Difference between revisions

Content added Content deleted
Line 1,020: Line 1,020:
ps -ant
ps -ant
ps -anp
ps -anp

*top

%cpu Section

us user cpu time (or) % CPU time spent in user space
sy system cpu time (or) % CPU time spent in kernel space
ni user nice cpu time (or) % CPU time spent on low priority processes
id idle cpu time (or) % CPU time spent idle
wa io wait cpu time (or) % CPU time spent in wait (on disk)
hi hardware irq (or) % CPU time spent servicing/handling hardware interrupts
si software irq (or) % CPU time spent servicing/handling software interrupts
st steal time % CPU time in involuntary wait by virtual cpu while hypervisor is servicing another processor (or) % CPU time stolen from a virtual machine


Main Section:
%MEM directly related to RES, percentage use of total physical memory by the process.
VIRT total memory that this process has access to shared memory, mapped pages, swapped out pages, etc.
RES total physical memory used shared or private that the process has access to.
SHR total physical shared memory that the process has access to.

RES is most close to the memory used by the process in memory, excluding what’s swapped out.
This includes the SHR (shared physical memory) which mean it could have been used by some other process as well.


*ls
*ls
Line 1,075: Line 1,052:


*wget
*wget

*smem


*nslookup
*nslookup
Line 1,089: Line 1,064:
find . -type l -ls
find . -type l -ls
ls -la | grep "\->"
ls -la | grep "\->"

CPU Info:
lscpu
nproc
grep 'model name' /proc/cpuinfo | wc -l

Obtain the PID with a utility:
pgrep -n python
pidof chrome - return all PIDs
pidof -s chrome - return only 1 PID
ps -C chrome -o pid= - C = CMD


= Flows =
= Flows =