How to know if your NIC receive link

watch ethtool eth0
verifry if link detected or no and speed of network.
Sample Output
require: ethtool

0
By: israel
2009-03-24 20:03:25

These Might Interest You

  • Quick and kludgy rss parser for the recent tracks rss feed from last.fm. Extracts artist and track link. Show Sample Output


    3
    egrep "<link>|<title>" recenttracks.rss | awk 'ORS=NR%2?" ":"\n"' | awk -F "</title>" '{print $2, $1}' | sed -e 's/\<link\>/\<li\>\<a href\=\"/' -e 's/\<\/link\>/\">/' -e 's/\<title\>//' -e 's/$/\<\/a\>\<\/li\>/g' -e '1,1d' -e 's/^[ \t]*//'
    HerbT · 2009-11-28 13:19:05 1
  • I much prefer using /sbin/ip over /sbin/ifconfig for most everything. I find the interface and output to be much more consistent and it has many abilities that ifconfig, route, etc. do not. To get the mac address for only one interface, add 'show dev [interface]' to the 'ip link' part of the command: ip link show dev eth0 | grep 'link/ether' | awk '{print $2}' . Also, both this command and the ifconfig one do not require root access to run, so the sudo is not necessary. Show Sample Output


    1
    ip link | grep 'link/ether' | awk '{print $2}'
    markdrago · 2009-11-04 19:41:26 1
  • an extension of command 9986 by c3w, allows for link text. http://google.com,search engine will link the hyperlink with the text after the url instead of linking with the url as linktext Show Sample Output


    -2
    sed "s/\([a-zA-Z]*\:\/\/[^,]*\),\(.*\)/\<a href=\"\1\"\>\2\<\/a\>/"
    chrismccoy · 2012-01-06 13:55:05 0
  • you can just use one awk script to parse the rss feed. No need to pipe so many awk's and sed's. Its ugly and inefficient.


    2
    awk '/<link>/{gsub(/.*<link>|<\/link>.*/,"");print "<li><a href=\042"$0"\042> "t"</a>" } /<title>/{gsub(/.*<title>|<\/title>.*/,"");t=$0 }' file
    unixmonkey7109 · 2009-11-28 15:49:06 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: