fping is a program which uses the Internet Control Message Protocol (ICMP) echo request to determine if a host is up. fping is different from ping in that you can specify any number of hosts on the command line, or specify a file containing the lists of hosts to ping. Instead of trying one host until it timeouts or replies, fping will send out a ping packet and move on to the next host in a round-robin fashion. If a host replies, it is noted and removed from the list of hosts to check. If a host does not respond within a certain time limit and/or retry limit it will be considered unreachable.

Basically fping is meant to be used in shell scripts and its output is easy to parse. This command can be very useful to when you have to scan whole network for alive or unreachable hosts. In case of usage regular ping command you’ll have to write shell script and parse each hosts icmp replies but fping can do the same in one line:

To scan range of IP addresses from to just run:
sudo fping -s -g -r 1

That will output: is alive is alive is unreachable is unreachable is unreachable is unreachable is unreachable is unreachable is unreachable

9 targets
2 alive
7 unreachable
0 unknown addresses

14 timeouts (waiting for response)
16 ICMP Echos sent
2 ICMP Echo Replies received
0 other ICMP received

0.05 ms (min round trip time)
0.44 ms (avg round trip time)
0.84 ms (max round trip time)
2.183 sec (elapsed real time)

In order to scan /24 network (254 hosts) and show only alive hosts the following command can be used:

sudo fping -a -q -g




  1. January 18, 2008  6:05 am by Kalyan Reply

    Hi Dudu

    Please help how to ping list of hosts specified in a file.if possible can u give it in a script.


  2. January 18, 2008  8:59 pm by admin Reply

    Hi Kalyan,

    You can try this:

    <code>cat /tmp/ips | xargs -n 1 ping -c 10</code>

    this will ping ip addresses listed in /tmp/ips with 10 packets each.

    P.S. <code>viper-laptop:~$ cat /tmp/ips</code>

  3. January 24, 2008  12:15 pm by pellgarlic Reply

    from "man fping" -

    -f Read list of targets from a file. This option can only be used by the root user. Regular users should pipe in the file via stdin:

    % fping

  4. January 24, 2008  12:16 pm by pellgarlic Reply

    ok.... obviously i need to put <code> tags in there :0 i'll try again:

    <code>-f Read list of targets from a file. This option can only be used by the root user. Regu?

    lar users should pipe in the file via stdin:

    % fping

    hope that's clearer...

  5. January 24, 2008  12:18 pm by pellgarlic Reply

    dammit! ok - type "man fping" and look for the "-f Read list of targets from a file...." bit. it's not showing it all when i paste in in here, dont know how too fix that, sorry.

  6. January 24, 2008  12:20 pm by pellgarlic Reply

    ok, one last try -

    <code>-f Read list of targets from a file. This option can only be used by the root user. Regular users should pipe in the file via stdin:</code>

    <code>% fping

    if that hasn worked, i'm leaving it alone :)

  7. January 24, 2008  12:20 pm by admin Reply

    Thanks pellgarlic!

    Yes, here is example of usage fping:

    <code>fping < /tmp/ips</code>

    That will ping range of IP listed in /tmp/ips IN PARALLEL, by the way:


    viper-laptop:~$ cat /tmp/ips


    Hope it helps! :)

  8. January 24, 2008  12:21 pm by pellgarlic Reply

    nope - it's cutting bits out - read the "man" page for the full info

  9. January 24, 2008  12:22 pm by pellgarlic Reply

    ahh... admin - how did you get the "less than" arrow to show up? it kept cutting it out for me :)

  10. January 24, 2008  12:24 pm by admin Reply

    Just cover your text with <code></code> tags :)

  11. January 24, 2008  12:27 pm by admin Reply

    Oh yeah, it works:


    sudo fping -f /tmp/ips is alive is alive is alive



  12. January 24, 2008  12:50 pm by pellgarlic Reply

    cool :) i tried the <code></code> tags, but it kept cutting out bits anyway - nevermind - you got the important info up there, and that's what matters.

    another victory for the www! knowledge is power! :D

  13. January 30, 2008  6:13 am by Kalyan Reply

    sudo fping -f /tmp/ips is alive is alive is alive

    Hi pellgarlic

    Thanks for all the above comments,i followed the above with little modification to suit my need and it's working fine.


  14. January 30, 2008  6:15 am by Kalyan Reply

    Hi admin



  15. January 30, 2008  2:23 pm by admin Reply

    Hi Kalyan, you're more than welcome! :)

  16. February 5, 2008  5:25 am by Kalyan Reply

    Hi admin,pellgarlic

    I am using below script my problem is here,i put this script in crontab to run daily 3 times and move the file "stb" to desktop of another system in the network by using " mv /root/stb /root/livestb.`date +%d%I%M` && scp livestb.* root@" as a script but final output on the desktop is empty file.



    #Script to ping all the hosts


    rm /root/livestb.* && echo "File removed successfully" #To remove previously run file

    fping /root/stb

    echo " ***completed*** "

    exit 0

    Please can u correct me.

    thanks in advance.

  17. February 5, 2008  10:47 am by pellgarlic Reply

    hi kalyan, what you're missing is the redirection... you would need to replace "fping /root/stb" with something like this:

    "fping -f /file/with/list/of/ips/to/ping > results/of/fping"

    (i.e. - you need 2 files -

    1 - the list of ip addresses to ping

    2 - the output of the fping command)

  18. February 5, 2008  10:48 am by pellgarlic Reply

    so, maybe something like this:

    fping -f /root/stb > /root/livestb.`date +%d%I%M`

  19. February 5, 2008  2:44 pm by pellgarlic Reply

    it seems that you may be confusing the file that fping reads from, with a file you want to have the output stored in -

    to have fping read from a file, do this:

    fping -f /path/to/file

    to save the ouput of fping to a file, do this:

    fping -f /path/to/file > /path/to/save/to

    (the ">" can be used to redirect the terminal output of any command-line command to a file)

  20. July 15, 2008  8:09 am by alvaro Reply

    Personally, i think it's better to use

    <code> rm -rf /root/livestb.* </code>


    <code> rm /root/livestb.* && echo "File removed successfully" </code>

    By the way, i recommend you not to make scripts with root powers (uhm, quite dangerous).


  21. July 25, 2008  3:05 am by kalyan Reply

    Hi friends,

    Thanx for all your replys.



  22. August 26, 2008  10:20 pm by hozefa Reply

    Can you guys help me install fping so that I can run it through Cygwin on a windows desktop.


  23. May 14, 2009  9:40 am by MoaVoa Reply

    For ugly scan :

    for i in `seq 1 255`; do echo -n "192.168.1.$i - " >> scan_lan.txt ;fping -n 192.168.1.$i >> scan_lan.txt; done

    (need improvement ;p)

  24. January 23, 2012  10:02 pm by Lukas Reply

    Hi, is anybody here yet?

    I have a problem with fping or I dont know which parametr I have to use, becouse my result are diffent in many times:

    root@deb0-manager:~# fping -a -q -g
    root@deb0-manager:~# fping -a -q -g
    root@deb0-manager:~# fping -a -q -g

    The first is how it is in reality...
    Have I change some parameters of fping? How? Please help me. Thnaks

  25. June 14, 2012  2:33 pm by Amol Reply

    I want to know how to run fping in crontab
    as it should be run by root
    how to issue privileges to the crontab executable file containing fping command..

  26. Pingback : Phan Nguy?n | Networking | Sys Admin | Linux/Unix

  27. April 27, 2013  12:49 am by bluehost promo code Reply

    However, the cost and hassle of maintaining a paid space is not recommended for personal bloggers who are not using their
    blog as a storefront for their business or online resume. Their hosting plans can
    help you increase your marketing reach and take your business to the next level.

    But - you must have a clear understanding of the information you are being given.

Leave a reply


Your email address will not be published.