Blink LED Port of NIC Card

ethtool -p eth0
Blinks LED of a NIC card. Its used when you have multiple NICs and you want to identify the physical port of a particular ethernet card.

15
By: shadyabhi
2010-10-28 16:07:18

These Might Interest You

  • You don't need this command often and there are other ways to test output but if you want to be sure if your router and ethernet card are working this is one way. Show Sample Output


    0
    sudo tcpdump -i eth0 -n port 67 and 68
    wsv123456 · 2010-08-18 19:36:06 2
  • Send microphone audio to another computer using netcat and arecord. Connect to the stream using "nc [other ip] 3333|aplay" You can set up two-way communication by piping audio the reverse direction on another port: Machine #1: arecord -D hw:0,0 -f S16_LE -c2|nc -l 3333 &;nc -l 3334|aplay Machine #2: $ip=[machine1_ip];arecord -D hw:0,0 -f S16_LE -c2|nc $ip 3334 &;nc $ip 3333|aplay


    4
    port=3333;card=0;subdevice=0;arecord -D hw:${card},${subdevice} -f S16_LE -c2|nc -l $port
    Evidlo · 2013-12-30 02:41:06 0
  • Depending on the TERM, the terminfo version, ncurses version, etc.. you may be using a varied assortment of terminal escape codes. With this command you can easily find out exactly what is going on.. This is terminal escape zen! ( 2>&2 strace -f -F -e write -s 1000 sh -c 'echo -e "initc\nis2\ncnorm\nrmso\nsgr0" | tput -S' 2>&1 ) | grep -o '"\\[^"]*"' --color=always "\33]4;%p1%d;rgb:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\33\\\33[!p\33[?3;4l\33[4l\33>\33[?12l\33[?25h\33[27m\33(B\33[m" Lets say you want to find out what you need to echo in order to get the text to blink.. echo -e "`tput blink`This will blink`tput sgr0` This wont" Now you can use this function instead of calling tput (tput is much smarter for portable code because it works differently depending on the current TERM, and tput -T anyterm works too.) to turn that echo into a much faster executing code. tput queries files, opens files, etc.. but echo is very strait and narrow. So now you can do this: echo -e "\33[5mThis will blink\33(B\33[m This wont" More at http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html Show Sample Output


    3
    termtrace(){( strace -s 1000 -e write tput $@ 2>&2 2>&1 ) | grep -o '"[^"]*"';}
    AskApache · 2010-03-17 08:53:41 0
  • This is an commandline utility to get fair piece of information about the attached network card. Show Sample Output


    0
    ethtool eth0
    unixbhaskar · 2009-08-28 04:22:03 0

What Others Think

Thanks, really useful for me
zolden · 399 weeks and 1 day ago
Thanks, this is my 2ct: ethwireck can detect if the physical layer of the Ethernet is up. This can then be used in the init script for your network card to determine whether or not an interface should be brought up. You can branch then and bring e.g the cooper ethernet interface up if a wire is plugged in otherwise use wlan. ethwireck implements basically the link state of ethtool and mii-tool in one program. http://linuxfocus.org/~guido/ethwireck-1.3.tar.gz
vlan7 · 399 weeks ago

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: