nmap -sP -T Insane

Ping a range of addresses

Sample Output
Starting Nmap 4.76 ( http://nmap.org ) at 2009-03-07 12:14 CET
Host appears to be up.
Host appears to be up.
Host appears to be up.
Host appears to be up.
Nmap done: 254 IP addresses (4 hosts up) scanned in 2.70 seconds

By: gcarpent
2009-03-07 08:41:21

These Might Interest You

  • If you need to ssh into a computer on the local network but you're unsure of the ip to use, then ping them and see if you get a response. If you do, print out the address you got it from. Adjust the range to suit your network.

    for i in 192.168.1.{61..71};do ping -c 1 $i &> /dev/null && echo $i;fi;done
    AlecSchueler · 2009-08-26 06:04:24 8
  • nmap accepts a wide variety of addressing notation, multiple targets/ranges, etc.

    nmap -sP
    wwest4 · 2009-02-11 20:44:43 1
  • This command uses ping to get the routers' IP addresses to the destination host as traceroute does. If you know what I mean..

    for i in {1..30}; do ping -t $i -c 1 google.com; done | grep "Time to live exceeded"
    fossilet · 2012-02-19 13:37:04 4
  • %t are tens. %d are digits. One may have further outer loops to provide hundreds, thousands, etc. This example applies ping to the numbered machines. The pattern can be used in other ways to apply all combinations of components to a task. Show Sample Output

    c:\>for %t in (0 1 2 3 4 5 6 7) do for %d in (0 1 2 3 4 5 6 7 8 9) do ping -n 1 machine-0%t%d
    bugmagnet · 2012-09-18 03:31:52 0
  • prips usage: prips [options] -c print range in CIDR notation -d set the delimiter 'x' where 0 =< x =< 255 -h display this help message and exit -f set the format of addresses (hex, dec, or dot) -i set the increment to 'x' -e e.g. -e ..4. will not print 192.168.4.[0-255] Report bugs to Peter Pentchev

    Zt3 · 2011-08-08 08:08:52 1
  • Usefull for when you don't have nmap and need to find a missing host. Pings all addresses from to, modify for your subnet. Timeout set to 1 sec for speed, if running over a slow connection you should raise that to avoid missing replies. This will clean up the junk, leaving just the IP address: for i in {1..254}; do ping -c 1 -W 1 10.1.1.$i | grep 'from' | cut -d' ' -f 4 | tr -d ':'; done Show Sample Output

    for i in {1..254}; do ping -c 1 -W 1 10.1.1.$i | grep 'from'; done
    SuperJediWombat · 2010-04-07 16:57:53 0

What Others Think

There's no need for -T insane. You'll be sacrificing accuracy for speed. Further, you can shorten the command a little bit: nmap -sP
atoponce · 480 weeks and 2 days ago
nice :D, thumbs up to you too atoponce
linuxrawkstar · 480 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: