When you use the command ifconfig, it displays lot of information to the console and for a non technical person it could be very confusing to get where the IP address details. The easiest way to display only the IP address using Terminal command ipconfig is by using it options getifaddr en0
Example:$ ipconfig getifaddr en0
Output: 192.168.225.137

Get only the IP address details using ipconfig
You can also make use of ifconfig command combine grep and awk commands to filter out the IP address.
bash-3.2$ ifconfig
lo0: flags=8041<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16382
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
anpi0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether 1e:29:c0:20:2e:48
inet6 fe80::1c29:c0ff:fe20:2e48%anpi0 prefixlen 64 scopeid 0x4
nd6 options=201<PERFORMNUD,DAD>
media: none
status: inactive
anpi1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether 1e:29:c0:20:2e:49
inet6 f180::1c29:c0aa:fe11:aa49%anpi1 prefixlen 64 scopeid 0x2
nd6 options=201<PERFORMNUD,DAD>
media: none
status: inactive
en3: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether 1a:21:c0:20:2e:28
nd6 options=201<PERFORMNUD,DAD>
media: none
status: inactive
en4: flags=8861<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether 1e:11:c0:21:2e:12
nd6 options=201<PERFORMNUD,DAD>
media: none
status: inactive
en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=460<TSO4,TSO6,CHANNEL_IO>
ether 12:1f:73:31:f2:82
media: autoselect <full-duplex>
status: inactive
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=460<TSO4,TSO6,CHANNEL_IO>
ether 12:1f:73:31:f2:82
media: autoselect <full-duplex>
status: inactive
ap1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether 312:1f:73:31:f2:82
media: autoselect
status: inactive
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether 12:1f:73:31:f2:82
inet6 fe10::12b4:d2da:7345:a622b%en0 prefixlen 64 secured scopeid 0xb
inet6 2409:4040:d83:bd3d:4f4:f553:2c2c:bdc4 prefixlen 64 autoconf secured
inet6 2409:4040:d83:bd3d:e43d:395:23bc:1cb1 prefixlen 64 autoconf temporary
inet 192.168.225.137 netmask 0xffffff00 broadcast 192.168.225.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 12:1f:73:31:f2:82
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x0
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 8 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 9 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: <unknown type>
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether 12:1f:73:31:f2:82
inet6 fe10::b117:11ff:fe22:12b8%awdl0 prefixlen 64 scopeid 0xd
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
llw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether 12:1f:73:31:f2:82
inet6 fe80::bcb7:27ff:fe63:8bb8%llw0 prefixlen 64 scopeid 0xe
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
inet6 fe10::b117:11ff:fe22:12b8%awdl0 prefixlen 64 scopeid 0xd
nd6 options=201<PERFORMNUD,DAD>
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
inet6 fe10::b117:11ff:fe22:12b8%awdl0 prefixlen 64 scopeid 0xd
nd6 options=201<PERFORMNUD,DAD>
Extracting only the required private IP address details,
$ ifconfig | grep "inet.*broadcast.*" | awk '{print $2}'
192.168.225.137

Ifconfig command to get private ip details
Have Questions? Post them here!
More Posts related to HowTos,
- Merge multiple zip files without unzipping (extracting)
- BSNL Broadband upgrades speed to minimum 2MBps for all users 512Kbps 1Mbps
- Static IP MTNL available at Rs. 200 per month
- Gmail Unable to upload because it is a folder or a package (like an application bundle or RTFD document)
- How to rerun last command in Zsh shell
- [Error] There was an error connecting to the apple id server
- Command to get count of only directories [macOS/Linux/Unix]
- Turn off Focus Mode on Mac
- Fix NVIDIA GeForce Experience ERROR CODE 0x0003
- How to submit website to dmoz directory
- How to stop or quit cat command?
- How to display only IP address using Terminal command
- Command: How to scp a file to remote server location?
- How to add Widgets to MacBook Desktop
- [IRCTC] Indian railways official eRail API 1.1 for developers to get train info
- [Fix] Steam: Friends Network Unreachable Error
- How to replace &nbsp; with space
- How to change font, apply bold or italic styles, font size in Windows Notepad
- SQL: Check if table exists
- How to identify the version of IntelliJ
- How to fix: Please check your network connection (Retry)
- Top 10 emerging breakthrough trending technologies
- 100+ SEO Tips to improve your website search ranking
- How to enable line numbers in IntelliJ
- How to write hello world different languages syntax
More Posts:
- 12 August - International Youth Day celebrated worldwide - News
- Your JBoss Application Server 7 is running However you have not yet added any users to be able to access the admin console - Java
- airbnb website and mobile App is down worldwide - clear browser cache or reinstall app to fix error - News
- Mac (macos) startup keyboard boot sequence combinations - MacOS
- Test internet speed using macOS Terminal command - MacOS
- zsh: command not found [fix] macOS - zsh
- How to install Postman natively on a Mac - HowTos
- Add blank lines after each lines using Notepad++ text editor - NotepadPlusPlus