An easy-to-use bash script for retrieving and displaying IP addresses for network interfaces with support for both IPv4 and IPv6 addresses.
- 🌐 Supports both IPv4 and IPv6 addresses
- 🖥️ List all network interfaces
- ⚙️ Display IP addresses for specific interfaces
- 📋 Raw output mode for scripting
- 🛠️ Easy installation and update options
# Direct installation
curl -sSL https://raw.githubusercontent.com/ErvisTusha/GetIP/main/getip.sh | sudo bash -s install
# Or clone and install
git clone https://github.com/ErvisTusha/GetIP.git
cd GetIP
./getip.sh install
# Display IP addresses for all interfaces
getip.sh
# Display IP addresses for a specific interface
getip.sh eth0
# List all network interfaces
getip.sh --list
# Display only IPv4 addresses
getip.sh eth0 -4
# Display only IPv6 addresses
getip.sh eth0 -6
# Display raw IP addresses (no formatting)
getip.sh eth0 -4 --raw
Options:
-h, --help | Show this help message
-v, --version | Show version information
-l, --list | List all network interfaces
--raw | Display IP addresses only (no formatting)
-4 | Show IPv4 addresses only (default)
-6 | Show IPv6 addresses only
install | Install script to /usr/local/bin
update | Update to latest version
uninstall | Remove script from system
- Bash shell
ip
command (fromiproute2
package)awk
command (preferably GNU Awk)
This script was developed using:
- VSCode as the primary IDE
- Claude 3.5 Sonnet for AI assistance
- Modern bash scripting practices
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
file for more information.
Ervis Tusha
- X: @ET
- GitHub: @ErvisTusha
- VSCode team for the excellent IDE
- The open-source community for inspiration
Made with ❤️ by Ervis Tusha