12/2/24, 10:13 Network | Basic | Cheat sheet | Linux Command Library
LINUX COMMAND LIBRARY
BASICS TIPS COMMANDS
Network
External ip Configure network interface
$ curl ifconfig.me $ ifconfig
$ dig +short myip.opendns.com @resolver
1.opendns.com
Show the hostname of your box
$ netcat icanhazip.com 80 <<< $'GET / HT
$ hostname [ip]
TP/1.1 Host: icanhazip.com ' | tail -n1
Get wifi password Trace the path that a packet takes
to its destination
$ cat /etc/NetworkManager/system-
connections/[SSID] | grep psk= $ traceroute [ip]
List network interfaces Telnet connection
$ lspci | egrep -i --color 'network|ethernet' $ telnet [ip] [port]
$ ifconfig -a
$ ip link show DNS lookup and display server
answer
$ lshw -class network
$ dig [ip]
$ cat /proc/net/dev
Release ip and get a new one from
Download file DHCP
$ wget [url] $ dhclient -r
$ curl -O [url]
List open sockets
Get information about domain $ netstat -l
$ whois [ip] $ lsof -i
Ping to another device
$ ping [ip]
https://linuxcommandlibrary.com/basic/network 1/2
12/2/24, 10:13 Network | Basic | Cheat sheet | Linux Command Library
All man pages are copyrighted by their respective authors. Thanks to TLDR and commandlinefu.com
Simon Schubert - info@linuxcommandlibrary.com
My other projects:
https://linuxcommandlibrary.com/basic/network 2/2