33

I run ping <hostname> command in console and it now outputs hundreds of those rows now (icmp_seq=526 ttl=64 time=0.026 ms), icmp_seq is like 500 or more now. How to stop it? (linux debian) Should i just close console?

Never mind, it stopped on 532. Hahah.

3
  • 13
    You can also limit the count: ping -c 10 localhost
    – jscott
    May 11, 2011 at 13:23
  • in my cmd , this works : ping -n 10 localhost , -c is invalid...it says BAD OPTION -c.
    – sqlchild
    Sep 26, 2013 at 7:08
  • 1
    ping -n 10 is typical of microsoft ping. ping -c 10 is typical of modern linux (e.g. where it comes from iputils package for redhat or debian). The foundational ping by Mike Muuss had the count as an optional third argument. The command line details of the 1933 Marjorie Flack version are unclear.
    – mc0e
    Sep 3, 2015 at 12:46

2 Answers 2

53

Press Ctrl+C or Ctrl+|.

0
1

Ctrl+Shift+C works too if you have shortcuts enabled in your terminal. (ubuntu)

2
  • Voted +1, this worked in my case, although I couldn't find any shortcuts (I use Ubuntu 17.Xxx). When I just press Ctrl+C in console , I get nothing (I guess it's used as "Copy" in my case?), but when I press Ctrl+Shift+C, I get output in console as "^C". Feb 25, 2018 at 10:17
  • Ctrl + shift doesn't work under Lubuntu 17.10; but this shortcut does. May 6, 2018 at 6:31

Not the answer you're looking for? Browse other questions tagged .