In versions before 15.04 there used to exist
nm-tool - utility to report NetworkManager state and devices
The nm-tool utility provides information about NetworkManager, device, and wireless networks.
This small utility would interface nicely with the Network Manager and produce a report with appropriate information on each line, which was quite simple to parse with text processing utilities. Sample output:
$ nm-tool | sed -ne '/^ *IPv4/,/^$/p'
Prefix: 24 (255.255.255.0)
Rinzwind's answer on the related question has cited the changelog for Network Manager package, which explains that it has been dropped upstream and superseded by
nmcli. It should be noted, however, that
nmcli before and after 15.04 differs with several command-line arguments. Here's alternative to the above:
$ nmcli dev show | grep 'IP4\.ADDRESS\|IP4.GATEWAY'
nmcli information is shown in accordance with each interface, i.e. there's set of lines for one interface, then separated by a blank line another set of lines and so forth.
Another alternative that one can use would be
ip command which is preferred nowadays to
ifconfig. According to pilona's and Gilles's answers on Difference between 'ifconfig' and 'ip' commands, Linux kernel and networking features have advanced forward but
ifconfig and the package to which it belongs haven't evolved in a long time, and that's why we have
ip utilities. For getting the addressing information on specific interfaces
ip -o -4 addr can be used and
ip route can be used for getting routing/gateway information.