Skip to main content

Unix system utility

Linux command

  • Get json response and format it
curl -X <METHOD-GET-POST> "<URL>" -H "Content-Type: application" | python -m json.tool
  • Get the running process in all ports
sudo ss -tulpn | grep LISTEN
  • SD card speed test
dd if=/dev/zero of=/tmp/testfile.img bs=20M count=5 oflag=direct
Example output
SD card speed test
pi@raspberrypi:~ $ dd if=/dev/zero of=/tmp/testfile.img bs=20M count=5 oflag=direct
5+0 records in
5+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 3.35802 s, 31.2 MB/s
  • Check if certain user group exist
cat /etc/group | grep <GROUP_NAME>

# ex.
cat /etc/group | grep docker
  • Create a new user group
sudo groupadd <GROUP_NAME>
  • check what group the user belongs to
groups <USER_NAME>
  • Add user to a group
sudo usermod -aG <GROUP_NAME> <USER_NAME>
  • Refresh group info
newgrp <GROUP_NAME>