ping 8.8.8.8
# ctrl z (send process to background)
ps
jobs -l
fg 1
kill -l
kill -9 <pid>fg# ctrl c
ping -c 4 8.8.8.8
Traceroute
tracert(windows) will use ICMP echo requests.
traceroute(linux) defaults to UDP echo requests.
traceroute google.com
mtr google.com
IP
# These are all the same
ip a
ip addr
ip address
ip address show
ip link
ip route
ip neigh # ARP
sudo ip address add 192.168.121.45/24 dev enp0s3
sudo ip address del 192.168.121.45/24 dev enp0s3
ip route get 1.1.1.1
ip link set enp0s3 down
man route # Checkout flags
route
sudo ip route add 192.168.121.0/24 dev enp0s3
sudo ip route del 192.168.121.0/24
DNS
nslookup example.com 8.8.8.8
watch !!# Will rerun the last command ever few seconds. Good for waiting for DNS up propagate.# Replacement for nslookup
dig example.com
# Resolved
cat /etc/resolve.conf
ll /etc/resolve.conf
sudo systemctl status systemd-resolved
systemd-resolve --status
cat /etc/systemd/resolved.conf
# Hosts file
cat /etc/hosts
# see established connections on specified port
ss -n -o state established '( dport = :21 or sport = :21 )'# List all connections
ss -a
# List listening sockets
ss -l
netstat
netstat -naob
# What is running on port 80
netstat -tulpn | grep 80