|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Tips, Tricks & Tweaks Tips and Solutions for SUSE Linux
(Please do not post questions here) |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
For those of us missing the ipconfig tool as used in windows here's a little bash script to display the wanted configuration (always miss the quick display of my ip settings).
Create a file called ipconfig in the /bin directory paste the script into it and make the file executable... Hope you find it useful. ---------------------begin here #!/bin/bash clear echo '--------------------------------------------------' echo echo '* IP Addresses on Ethernet interfaces:' /sbin/ifconfig | grep -A1 eth echo echo '* Name Servers:' cat /etc/resolv.conf | grep name | grep -v '#' echo echo -n '* ' route | grep default echo ' gateway ' echo echo '* Other routes: ' route | grep -vi 'kernel ip routing table' | grep -vi default echo end here--------- edit: small cleanup |
|
|||
|
Try:
"man ifconfig" "man iwconfig" for tools like "ifconfig -a"; plain old "iwconfig"; and all the power that goes with them. |
|
|||
|
Quote:
There is much power in those tools ...but its a little too much if you want to see your basic settings... also i[f-w]config don't report back name servers or route as far as I know? |
|
|||
|
Quote:
The problem you run into is people become dependent on scripts that may not always be available..the better solution is to learn how to use the native tools that will always be available on any linux version etc..... That being said...you had enough knowledge to write the script and format it like you wanted....you are not who I'm worried about...I'm worried about the new user who grabs your script and then never learns how to do it the "normal" way. Sort of the same reason you don't see mv aliased to move, rm aliased to delete and cp aliased to copy. |
|
|||
|
Quote:
|
|
|||
|
here's something else, i don't know how useful anyone will find it though. if you add this, below, to the end of ~/.bashrc, then run it by opening a terminal and running netinfo
Code:
netinfo ()
{
echo "--------------- Network Information ---------------"
/sbin/ifconfig | awk /'inet addr/ {print $2}'
echo ""
/sbin/ifconfig | awk /'Bcast/ {print $3}'
echo ""
/sbin/ifconfig | awk /'inet addr/ {print $4}'
# /sbin/ifconfig | awk /'HWaddr/ {print $4,$5}'
echo "---------------------------------------------------"
}
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|