Skip to content

Extract information

Max Nilsson edited this page Nov 18, 2023 · 3 revisions

Check kernel version

uname -a

will print something like this

Linux <hostname> 6.0.1-060001-generic #202210120833 SMP PREEMPT_DYNAMIC Wed Oct 12 08:37:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Check IP address

ip addr show

One way to get your public IP address is to curl icanhazip.com

curl -4 icanhazip.com

Check disk space

df

Check for open ports

sudo ss -tulpn

Get process (PID) of something running on a specific port

lsof -i :8888

If you lost your dev server on port 8888 and want to shut it down, run

kill -9 <pid>

You can combine it with lsof -i :8888 -t (-t will make it only return the PID number).

sudo kill -9 $(lsof -i :8888 -t)

Check temperature (Raspbery Pi)

GPU

vcgencmd measure_temp

CPU

cat /sys/class/thermal/thermal_zone0/temp

or

cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$((cpu/1000)) c"