Useful nmap commands
If you had a script kiddie phase, like I had, you're probably aware of the tool nmap. Sysadmins probably know of this tool too, but every script kiddie tutorial includes port scanning a server, so that's where I know it from. Turns out there is a plethora of use cases for this versataile tool, some of which I will outline here. This text will get updated over time when I find a new application for nmap.
Getting all MAC and IP addresses of the devices in your LAN
sudo nmap -sn 192.168.178.0/24
# or alternatively the older version
sudo nmap -sP 192.168.167.0/24
There are two versions of this command, the command with the -sP flag being the older one. What this does is a ping scan, as opposed to a port scan, which essentially omits the port scanning port and only lists the discovered hosts.