Hello ,
You can use below shell script to extract only IP address from ip command.
Command : ip addr show | grep -oP 'inet \K[^/]+'
Example:
[root@server cgi-bin]# ip addr show | grep -oP 'inet \K[^/]+'127.0.0.110.0.2.15192.168.56.102
Note: If you are trying to use ip command in cron jobs, please use as /sbin/ip
Hope it helps you.
...
Fix: Command not found for whois and dig
Hello,
If you have not installed bind-utils then you wont be able to execute dig commands. basically dig command can be used to DNS information and reverse lookup of a host etc.
To install dig commands , type below commands in your terminal
yum install bind-utils
Then you can try with
dig google.comdig...
Subscribe to:
Posts (Atom)