One way to to get the IP address of a Linux system from the Linux command line is this:
$ hostname -I
That’s the hostname
command, followed by a capital letter i
as a command line parameter. On my Raspberry Pi system, this command returns its IP address — and only its IP address — like this:
10.0.1.9
It’s nice that this command returns only the IP address, because that means I don’t have to pipe together several commands to get what I need.