Find errors and packet loss on network cards

ethtool -S eth0 | egrep "(drop|disc|err|fifo|buf|fail|miss|OOB|fcs|full|frags|hdr|tso).*: [^0]"
A grep against ethtool to look for common errors and packet loss statistics which network drivers report in their private data, which is queried with ethool -S. This is the current grep used in xsos (https://github.com/ryran/xsos), which I originally contributed and has been improved by the community over time.
Sample Output
    rx_fw_discards: 1035

These Might Interest You

  • Produces a CSV file containing fronts/backs of cards with specified tag ("mytag" above). This command pulls these cards from different card databases, and allows them to be merged into one (by importing the resulting CSV file). The CSV file is not directly produced; instead of commas, "||" are inserted. In your editor of choice, modify the resulting file to put quotes around the text before || and after ||, then change || to a comma (for every line).


    0
    for i in `ls *.anki`; do sqlite3 $i "select (cards.question || '||' || cards.answer) from cards, facts where cards.factid=facts.id and facts.tags like '%mytag%';" >> mytag.csv; done
    joshuaeckroth · 2012-03-13 19:03:20 0

  • -44
    ipconfig /all
    BrianBBrian · 2009-03-06 17:36:07 11
  • sending packet by ping if sending more high packet root needed... Show Sample Output


    -3
    sudo ping -f -c 999 -s 4500 target.com
    gunslinger_ · 2010-07-11 16:38:44 0
  • Get the IP address of all your network cards. Show Sample Output


    -6
    ifconfig | grep "inet [[:alpha:]]\+" | cut -d: -f2 | cut -d' ' -f2
    feraf · 2009-07-24 13:16:37 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: