Go back to LX0-101 - CompTIA Linux+ [Powered by LPI] Exam 1

Question :-

The output for the command ifconfigeth0 is shown below: Eth0 Link encap:Ethernet HWaddr 00:0C:29:CB:FA:30 inetaddr: Bcast: Mask: UP BROADCAST RUNNING MULTICAST MTU:1500 Metrlel RX packets:4721 errorsrO dropped:0 overruns:0 frame:0 TX packets:3216errors:0dropped:0overruns:0 carrier:0 collisions^) txqueuelen:1000 RX bytes:445184 (434.7 Kb) TX bytes:512968 (500.9 Kb) lnterrupt:185 Base address:0xl080 Which of the following commands should be used in a bash script that needs a variable containing the IP address of the eth0 interface?
IP=LANG= ifconfig ethO | awk'{print $2 )' | cut -f2
IP='LANG= ifconfig ethO | grep inet | cut-d: -f2 | awk {print $1 Y
IP='LANG= ifconfig ethO | awk'{print $3 }"
IP=$(LANG= ifconfigethO | grep inet | awk'{ print$2}' | cut-d: ^f2)
IP=$(LANG=ifconfigethO| grep inet | cut-d:-f2)

Want to practice for LX0-101 - CompTIA Linux+ [Powered by LPI] Exam 1 ? Click here.