Skip to content

Instantly share code, notes, and snippets.

@FromeXo
Last active April 3, 2023 09:39
Show Gist options
  • Select an option

  • Save FromeXo/40f2d710704b56e662c1a824210de9c5 to your computer and use it in GitHub Desktop.

Select an option

Save FromeXo/40f2d710704b56e662c1a824210de9c5 to your computer and use it in GitHub Desktop.
Display IPs in a cool way
if command -v jq &> /dev/null
then
echo "IPs"
ip -j -4 addr show | jq '.[].addr_info[] | .label + ": " + .local' | tr -d '"' | awk '{print $1 " " $2}'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment