LinuxCommandLibrary

Network

External IP

$ curl ifconfig.me
copy
$ dig +short myip.opendns.com @resolver1.opendns.com
copy
$ netcat icanhazip.com 80 <<< $'GET / HTTP/1.1\nHost: icanhazip.com\n' | tail -n1
copy

Get WiFi password

$ cat /etc/NetworkManager/system-connections/[SSID] | grep psk=
copy

List network interfaces

$ lspci | egrep -i --color 'network|ethernet'
copy
$ ifconfig -a
copy
$ ip link show
copy
$ lshw -class network
copy
$ cat /proc/net/dev
copy

Download file

$ wget [url]
copy
$ curl -O [url]
copy

Telnet connection

$ telnet [ip] [port]
copy
Copied to clipboard