Thursday, May 22, 2014

How to find out linux system IP Add with a single script

This script will find your system's IP add with the interface you are using currently .

just copy and past the following to  Desktop  .


 #!/bin/sh
ifconfig>/home/u-man/Desktop/1
grep "inet addr:" /home/u-man/Desktop/1>/home/u-man/Desktop/2
sed -n '2p' /home/u-man/Desktop/2
exit 0






save it as shell

now open terminal type :

cd /home/user/Desktop

sudo chmod +x shell

 now ./shell


see my output





No comments:

Post a Comment