Skip to content

Instantly share code, notes, and snippets.

@diasbruno
Created April 15, 2024 12:46
Show Gist options
  • Save diasbruno/547c2da00cf7482af732730041a9a086 to your computer and use it in GitHub Desktop.
Save diasbruno/547c2da00cf7482af732730041a9a086 to your computer and use it in GitHub Desktop.
Find host's IP
#!/bin/env bash
set -eu
ip -br a s eth0 | awk '{ split($3,a,"/"); print a[1]; }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment