Show Local IP
Show local IP
You can see the local IP of the machine with the command - ip a
. However if you have to use the address in
some variable in a scrit. It becomes little tricky, something like
- Show the interfaces in one line with ‘-o’
- Show only IPv4 address’s with ‘-4’
and the command looks like
|
|
Replace eth0 with then correct interface name.
However there is one more command that you can try
|
|