shell-scripts/inet/myip

4 lines
108 B
Text
Raw Permalink Normal View History

2023-07-06 11:07:16 -04:00
#!/usr/bin/bash
ip addr | grep -Po '\d+\.\d+\.\d+\.\d+/24' | awk '{ print substr($1, 0, length($1) - 3) }'