LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-12-2010, 02:30 PM   #1
Norwood
Member
 
Registered: Feb 2010
Location: A Smidge South O' Boston
Distribution: Debian
Posts: 41

Rep: Reputation: 15
Ping Command


Obviously we all use ping a lot, however I was wondering if there was a way to tweak it a bit.

At the end of a ping routine, it gives the user 4-5 lines of "statistics".

Is there anyway to suppress this behavior so that it just does it's ping and stops, no summary of how many packets transmitted, received or packet loss etc?

I understand there will be times when I will need this data so I would just set an alias for each instance.
 
Old 04-12-2010, 02:48 PM   #2
DragonM15
Member
 
Registered: Sep 2003
Location: USA
Distribution: Slackware (Multiple Versions)
Posts: 455

Rep: Reputation: 31
You could simply pipe the output to something like awk, you only output the information you want. Is this what you would like to do? What information do you want? Just the time it took to ping?
 
Old 04-12-2010, 04:28 PM   #3
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 553

Rep: Reputation: 116Reputation: 116
If all you wanna do is ping and aren't bothered about the output (ie, just ping a server to keep it alive) then just redirect to /dev/null.
 
Old 04-13-2010, 08:23 AM   #4
Norwood
Member
 
Registered: Feb 2010
Location: A Smidge South O' Boston
Distribution: Debian
Posts: 41

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by DragonM15 View Post
You could simply pipe the output to something like awk, you only output the information you want. Is this what you would like to do? What information do you want? Just the time it took to ping?
Actually, I found a way. I just piped it through grep on 'icmp'!
 
Old 04-13-2010, 08:27 AM   #5
Norwood
Member
 
Registered: Feb 2010
Location: A Smidge South O' Boston
Distribution: Debian
Posts: 41

Original Poster
Rep: Reputation: 15
Hmm, but when I added that to my .bashrc ping didn't work.

Interesting.

Here's my alias for ping in .bashrc:

Code:
alias ping='ping -c6'
When I added:


Code:
alias ping='ping -c6 | grep icmp'
it failed.

But if I typed ping google.com it worked (even using my 6 count as outlined in my .bashrc.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ping command gr8linux Linux - Newbie 12 12-24-2009 12:12 AM
ping command hck_sec General 10 03-01-2007 06:48 PM
Simple question about command syntax ping/log ping results ohalnet Linux - Networking 1 07-25-2006 05:46 AM
ping command hypnotiks Linux - Networking 1 07-15-2004 10:34 PM
Ping command Manny88 Linux - General 41 09-24-2003 02:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration