Saturday, April 27, 2024
97
rated 0 times [  97] [ 0]  / answers: 1 / hits: 280232  / 2 Years ago, thu, april 21, 2022, 2:10:01

Usually I use ping to check my internet connection. In windows, if I use:



ping google.com


I get only 4 information ping, but on Ubuntu, if I use that command, the ping can' stop until I stop it with Ctrl+C. Can I ping only for 4 times then stopped? If I can, can I use it as default?


More From » command-line

 Answers
2

As Olive Twist already answered, ping -c 4 google.com will do it.



If you want to make this as a default, one way is to create an alias for ping with:



alias ping='ping -c 4'



Save it to your ~/.bashrc file to make it permanent or it will last only for the current terminal session.


[#34964] Saturday, April 23, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ugeeport

Total Points: 181
Total Questions: 108
Total Answers: 99

Location: El Salvador
Member since Tue, Jun 29, 2021
3 Years ago
;