If you are on a Bash Shell and want to know the IP address of your device, then you can make use of the ifconfig command.
Example:
As ifconfig may have too much information, we can pipe it with awk command to filter out just the IPs.
# ifconfig | awk '/inet / {print $1, $2}'
inet 127.0.0.1
inet 192.168.1.3
Of the output, the first IP 127.0.0.1 is the loopback address also called as localhost.
The second IP here 192.168.1.3 is my local Private IP..

-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Bash,
- Bash Hello World! Script Tutorial
- How to run bash command in background
- How to create new user account in Windows bash
- How to Compare Strings in Bash
- Bash: Allow Command to Fail without exiting Script
- Fix bash: script.sh: Permission denied Error
- Bash getopts Command Example
- How to fix bash ping command not found error
- How to add NewLine Character in Bash Script String
- How to Echo Bash Command to a File
- Bash Command to Find String in a File
- How to open new Terminal using Bash Command
- Bash How to Save Output of a Command to a Variable
- Download a SSL Certificate from a URL in Terminal
- Bash Command to Check IP Address
- Know Bash shell version command
- Bash Command To Check If File Exists
- How to run a Command in Bash Script
- How to Compare two Files in Bash Shell
- How to check if a variable is set in Bash Script or Not
- Convert String from uppercase to lowercase in Bash
- How to see Created Accessed Modified and Changed dates of a file using bash terminal command
- Bash Command To Get Current Time
- Bash command to List Files
- Fix: bash: syntax error near unexpected token
More Posts:
- Types of brackets used in Programming Languages - Codes - 2022
- How to sort a List using Lambda in Python - Python
- Setting Expire Time - EX EXAT PX PXAT and KEEPTTL with Spring Boot + Redis - Java
- JSON Datatypes : Tutorial - Json-Tutorial
- How to disable SharePoint subsite creation option for owners - SharePoint
- [Fix] Microsoft Windows Store error 0x00000005 (Windows 8/10/11) - Windows
- Installing vue.js in Laravel 8 - PHP
- Steps to Delete or Deactivate Instagram Account - HowTos