32

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.

Rihards
  • 759
  • 2
  • 12
  • 22
  • 13
    You can also limit the count: `ping -c 10 localhost` – jscott May 11 '11 at 13:23
  • in my cmd , this works : ping -n 10 localhost , -c is invalid...it says BAD OPTION -c. – sqlchild Sep 26 '13 at 07: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](https://web.archive.org/web/20141022060956/http://ftp.arl.mil/mike/ping.html) are unclear. – mc0e Sep 03 '15 at 12:46

2 Answers2

53

Press Ctrl+C or Ctrl+|.

Bart De Vos
  • 17,761
  • 6
  • 62
  • 81
1

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

G_Style
  • 151
  • 4
  • 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". – Askar Kalykov Feb 25 '18 at 10:17
  • Ctrl + shift doesn't work under Lubuntu 17.10; but this shortcut does. – KO the typo May 06 '18 at 06:31