Use --exclude option
Nmap ping scan
nmap -sP 192.168.0.1/24
Using the exclude option, we dont want to scan ip 99
nmap -sP 192.168.0.1/24 --exclude 192.168.0.99
this will exclude 192.168.0.64 through 192.168.0.127
nmap -sP 192.168.0.1/24 --exclude 192.168.0.65/26
Using --excludefile option
Add remote device to a file, example file name dont_scan_me
nmap -sP 192.168.0.1/24 --excludefile dont_scan_me
Using --iL option (include)
Create a file of ip address that you want to scan
nmap -sP 192.168.0.1/24 -iL scanme
You can create inlcude file with different methods, eg
192.168.0.1
192.168.0.2-3
192.168.*.4
Scan specific protocol or port number
I want to scan webservers on my local subnet
nmap 192.168.0.1/24 -p 80