This simple one liner will print out your IP address and then IPv6 equivalent if you have it set. [[email protected] ~]$ ifconfig enp6s1 | awk ‘/inet/ { print $2 } ‘ | sed -e s/addr:// 192.168.1.2 fe80::213:46ff:fe3a:283 Here is a way to only print the IPv4 address. [[email protected] ~]$ ifconfig enp6s1 | awk ‘/inet / …

The dhclient command on Linux is used to renew an IP address for a network interface. Here i am using Fedora 19 with the new standardised network interface names. [email protected] homer# dhclient -v wlp0s26f7u5 Internet Systems Consortium DHCP Client 4.2.5 Copyright 2004-2013 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/   Listening …

This is an interesting command to view your command history when you are using Bash. [[email protected] Desktop]$ hash hits command 3 /usr/bin/sudo 1 /bin/ls [[email protected] Desktop]$ This command is a Bash shell built-in command. If you are using the tcsh or zsh shells; this command will not be available to you. As shown below; you …

This perl script will print some information about your networking set-up on your Linux machine. #!/usr/bin/perl use warnings; $iface = “eth0”; @data = `ifconfig`; $net = $data[1]; $username = `logname`; $kernel = `uname -r`; printf(“\n*————————————-*\n”); printf(“Hello %s \nThe IP of %s is:%s\n”,$username, $iface, $net); printf(“The kernel version is: %s\n”, $kernel); printf(“\n*————————————-*\n”);