scan local network on ubuntu

sudo arp-scan --interface=eth0 --localnet

…where eth0 is your network interface.
You’ll find your network interface with:

ip a

If you want to exclude Unknown, then do:

sudo arp-scan --interface=enp0s31f6 --localnet | grep -vw Unknown

You can use nmap too:

nmap -sP 192.168.0.1/24

You have to use your real network ip and mask.(use command ip a)