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 Host: icanhazip.com ' |  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

Get information about domain

whois [ip]
copy

Ping to another device

ping [ip]
copy

Configure network interface

Show the hostname of your box

hostname [ip]
copy

Trace the path that a packet takes to its destination

traceroute [ip]
copy

Telnet connection

telnet [ip] [port]
copy

DNS lookup and display server answer

dig [ip]
copy

Release ip and get a new one from DHCP

dhclient -r
copy

List open sockets

netstat -l
copy
lsof -i
copy
Copied to clipboard