With a little side of applesauce...

Friday, September 25, 2009

ifconfig alias to hide unwanted interfaces

I have run VMWare for years, and get tired of scrolling up to find my eth0 IP Address. Here is a quick BASH function which hides the vmnet interfaces:

for c in $(sudo ifconfig -s | cut -d' ' -f1 | sed '1d; /vmnet/d'); do sudo ifconfig $c ; done



I just added it as a function to my .bashrc:
function ifcfg() { for c in $(sudo ifconfig -s | cut -d' ' -f1 | sed '1d; /vmnet/d'); do sudo ifconfig $c ; done; }

No comments: