One-liner to Get IP Address of Interface

DevOps Engineer | Kubernetes | Python | Terraform | AWS | GCP
The following command is enough for extract IP address from ifconfig command. It uses field separator ":" and " " (space) to cut the line into words.
ifconfig eth0 | grep 'inet addr' | awk -F'[: ]+' '{ print $4 }'




