Service and OS detection
Detect Operating Systems
Detect services
Service and OS detection use different methods to determine the operating system or service running on a particular port.
Detect services:
# nmap -sV -T4 -Pn -oG ServiceDetect -iL $TARGETFILE
OS detection:
# nmap -O -T4 -Pn -oG OSDetect -iL $TARGETFILE