Cheatsheet: Difference between revisions
→CPU
(→CPU) |
|||
Line 892:
; Top Command
<pre>
top - 01:07:37 up 2:40, 1 user, load average: 0.37, 0.37, 0.39
Tasks: 286 total, 1 running, 285 sleeping, 0 stopped, 0 zombie
%Cpu(s): 4.7 us, 1.6 sy, 0.0 ni, 93.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 15935.7 total, 9403.3 free, 3045.2 used, 3487.1 buff/cache
MiB Swap: 4100.0 total, 4100.0 free, 0.0 used. 11720.3 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6865 aman 20 0 982620 85280 53716 S 6.2 0.5 2:52.77 Xorg
10082 aman 20 0 3537624 285448 118848 S 6.2 1.7 5:45.24 gnome-shell
</pre>
CPU Section
Line 914 ⟶ 925:
This includes the SHR (shared physical memory) which mean it could have been used by some other process as well.
;Obtain the PID
pgrep -n python
pidof chrome - return all PIDs
Line 921 ⟶ 932:
▲;Memory
▲*Info
dmidecode -t 17
cat /proc/meminfo ==> egrep --color 'Mem|Cache|Swap' /proc/meminfo
top -o %MEM
free -m
total used free shared buff/cache available
Mem: 15935 3046 9470 767 3418 11787
Swap: 4099 0 4099
vmstat
vmstat -s ==> More detailed
htop
ps -o pid,user,%mem,command ax | sort -b -k3 -r
sudo pmap 917 ==> Libraries,
sudo pmap 917 | tail -n 1 ==> Total used by this process
lsblk ==> List Block Devices only in a tree structure
du
df -h
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda4 ext4 77G 51G 22G 71% /
sudo fdisk -l ==> Partition & FS Type details
parted ==> List out partitions and modify them
== Check IP and DNS info ==
|