Get information about an IP address using the command line on Linux.
How to get comprehensive IP address information with the command line on Linux.
How to get comprehensive IP address information with the command line on Linux.
How to resolve the hostname of an IP address using Visual Basic on Windows.
How to add another IP address to the loopback device on Linux.
Convert an IP address to binary easily.
How to get all network interfaces with Powershell on Windows. And how to filter the output of a cmdlet.
The Cowsay program is very useful for printing information in your terminal. There are quite a few cow files allowing many useful avatars to print in your terminal. Install this today. jason@Yog-Sothoth » ~ » $ sudo apt install cowsay Then run this command to list all the available *.cow files. jason@Yog-Sothoth » ~ » … Read more
Get IP address information using Netstat on Linux How to get IP address information using netcat and some other useful tips. user1@cloudshell:~$ netstat | awk ‘/tcp6/ { print $5 }’ 74.125.41.158:36146 173.194.93.92:48039user1@cloudshell:~$ netstat | awk ‘/tcp6/ { print $5 }’ 74.125.41.158:36146 173.194.93.92:48039 user1@cloudshell:~$ netstat | awk ‘/tcp6/ { print $5" – "$6,$4 }’ 74.125.41.158:36146 – … Read more
This example will get the current IP address(s) of the user`s machine. PS C:\Users\Intel i5> Get-NetIPAddress | Sort-Object -Property InterfaceIndex | where-object -FilterScript {$_.SuffixOrigin -eq "Dhcp"} IPAddress : 192.168.1.114 InterfaceIndex : 10 InterfaceAlias : Ethernet AddressFamily : IPv4 Type : Unicast PrefixLength : 24 PrefixOrigin : Dhcp SuffixOrigin : Dhcp AddressState : Preferred … Read more
This one-liner will print the current LAN IP address of a machine running Macintosh OSX. jason@. PWD: ~. -bash. 3.2.57. 10 $> ifconfig | grep "inet " | awk ‘FNR==2{print $2}’ 192.168.1.2jason@. PWD: ~. -bash. 3.2.57. 10 $> ifconfig | grep "inet " | awk ‘FNR==2{print $2}’ 192.168.1.2 This is 10.14.2 (18C54), but this command … Read more
This is an interesting command to view your command history when you are using Bash. ┌──[[email protected]]─[~] └──╼ ╼ $ hash hits command 1 /usr/bin/gethostip 1 /usr/bin/sudo┌──[[email protected]]─[~] └──╼ ╼ $ hash hits command 1 /usr/bin/gethostip 1 /usr/bin/sudo This command is a Bash shell built-in command. If you are using the tcsh or zsh shells; this command … Read more
Getting information about your IP address is easy in Powershell. Below is a simple example, this is printing information about the IP addresses on the system. PS C:\Users\Jim\Pictures\Saved Pictures> Get-NetIPAddress |Select-Object IPAddress IPAddress ——— fec0::6155:1c09:8069:d506%1 fe80::6155:1c09:8069:d506%7 ::1 10.0.2.15 127.0.0.1PS C:\Users\Jim\Pictures\Saved Pictures> Get-NetIPAddress |Select-Object IPAddress IPAddress ——— fec0::6155:1c09:8069:d506%1 fe80::6155:1c09:8069:d506%7 ::1 10.0.2.15 127.0.0.1 This is a … Read more
This one-liner will take your IP address and convert it into binary. This is very useful and fun to do. ┌──[[email protected]]─[~/Videos] └──╼ ╼ $ ipcalc `ip a | awk ‘/inet / { print $2 }’ | sed -n 2p | cut -d "/" -f1` | awk ‘/Address/ {print $3,$4}’ 11000000.10101000.00000001. 00000010┌──[[email protected]]─[~/Videos] └──╼ ╼ $ ipcalc … Read more
Getting the gateway IP address of your machine is a very important trick sometimes. This is very easy on Linux. Use the ip route command on Linux to print information about the IP routing. This includes the gateway IP address. ┌──[[email protected]]─[~/Videos] └──╼ ╼ $ ip route | grep default | awk ‘{print $3}’ 192.168.1.1┌──[[email protected]]─[~/Videos] └──╼ … Read more
How to get the total size of a folder using Linux scripting. ┌──[[email protected]]─[~/Documents] └──╼ ╼ $ du -ack -BM | sort -nr | head -n 1 | awk ‘{print $1}’ 30255M┌──[[email protected]]─[~/Documents] └──╼ ╼ $ du -ack -BM | sort -nr | head -n 1 | awk ‘{print $1}’ 30255M This shows the total size of … Read more
This useful one-liner will get your IP address from the command line very easily. This uses Google services and works very well. 4.4 Tue Jun 30 jason@Yog-Sothoth 0: $ dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | sed -e ‘s/^"//’ -e ‘s/"$//’ 209.134.104.2004.4 Tue Jun 30 jason@Yog-Sothoth 0: $ dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | sed -e … Read more
There are many ways to get networking information on your Linux computer. This is how to return the active network interface(s) on your Linux system. 4.4 Mon Jun 22 jason@Yog-Sothoth 0: $ ip addr | awk '/state UP/ {print $2}' | sed 's/.$//' enp0s25 Combining this command with another using backticks, it is possible to … Read more
This is how to get the current IP address of the active network adapter in your Windows system. PS C:\Users\Doom> (Test-Connection -ComputerName (hostname) -Count 1).IPV4Address.IPAddressToString 192.168.1.2PS C:\Users\Doom> (Test-Connection -ComputerName (hostname) -Count 1).IPV4Address.IPAddressToString 192.168.1.2 This prints the IP address of your machine to the Powershell terminal. This is a great way to get just the IP … Read more
I have installed SUN Solaris 10 in a Virtual Machine. This is fun to experiment with. SUN Solaris Java Desktop System. This uses a very nice desktop theme. Once installed it only has the root account. But you can su to root and then run the smc command at the prompt to load the Solaris … Read more
How to get just the adapter name when querying the adapter with ip a. This is a simple trick, this one-liner is not that elegant, but it does work. This allows me to get just the name of the adapter, and not any other extraneous information. 4.4 Wed Aug 07 jason@Yog-Sothoth 0: $ ip a … Read more
The nslookup command on UNIX and Linux may be used to get information about an IP address and tell you who it belongs to. This is very useful when using the Internet. This queries the DNS server and can tell you the domain name if any associated with the IP address. Below is an example. … Read more