misc cli notes
Unorganized list of cli commands I frequently need to look up.
-
restart network
doas /etc/init.d/networking restart -
use this command to add your Wi-Fi network to wpa_supplicant
doas sh -c "wpa_passphrase 'ExampleWifiSSID' 'ExamplePassword' >> /etc/wpa_supplicant/wpa_supplicant.conf" -
Scan wifi networks in range
ip link show # gives me the wlan0 interface name doas iw dev wlan0 scan | grep SSID # shows all the wifi networks in range -
to see device status and set up before running wpa_supplicant through the cli
ip link show wlan0 doas ip link set wlan0 up doas wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B -d -
show soft blocks on network devices
rfkill list -
show errors with wlan0
dmesg | grep -i wlan0 -
request a new ip address from the dhcp server
doas udhcpc -i wlan0 -f -v -
see all incoming dhcp reqests
doas tcpdump -i enu1u1u1 port 67 or port 68 -
Get network info and passwords
doas cat /etc/wpa_supplicant/wpa_supplicant.conf -
List all wifi networks in range
doas iw dev wlan0 scan | grep SSID -
Mount SD card using udisksctl
jone@phosphene ~ $ udisksctl mount --block-device /dev/sda 17:55:09 Object /org/freedesktop/UDisks2/block\_devices/sda is not a mountable filesystem. jone@phosphene ~ $ doas fdisk -l /dev/sda 17:55:24 doas (jone@phosphene) password: Disk /dev/sda: 60 GB, 63909658624 bytes, 124823552 sectors 3900736 cylinders, 1 heads, 32 sectors/track Units: sectors of 1 * 512 = 512 bytes Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type /dev/sda1 0,0,0 0,0,0 32768 124823551 124790784 59.5G 7 HPFS/NTFS jone@phosphene ~ $ udisksctl mount --block-device /dev/sda1 17:56:38 Mounted /dev/sda1 at /run/media/jone/HDZERO