Use the grep to filter your IP address from ifconfig:
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
Or with the help of sed:
ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'
If you are interested only in certain interfaces, wlan0, eth0, etc. then:
ifconfig wlan0 | ...
You can alias your command in the .bashrc to create your own command called myip for instance.
alias myip="ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'"
The simpler way is the hostname -I (hostname -i for older versions of hostname but see comments). However, this is on Linux only.
Come and join Linux training to gain great knowledge.