Lately i was tinkering a bit on my local area network. These are the commands i used (they will work on Mac OSX as well as on GNU/Linux):

ifconfig
– to see/edit network interface settings

ping http://www.example.com
– to see if a host is reachable, and with how much latency. http://www.example.com can also be replaced by an ip address.

traceroute http://www.example.com
– to see which and how many hops are between you and the server you’re pinging.

netstat
– show network status (initiated connections)

lsof -i
– show open network sockets

tcpdump -i en0 -w capturefile.pcap -s0
– capture all network traffic on the en0 interface, save in capturefile.pcap. without the -w option, you can monitor the data live.

arp -a
– list all hosts on the local network, currently seen by your client, with ip and MAC addresses

nslookup http://www.example.com
– do a dns request for http://www.example.com

ssh user@hostname
– login to a remote host via a secure shell

scp user@hostname:/home/user/example.txt /home/me/Desktop/
scp /home/me/Desktop/example2.txt user@hostname:/home/user/
– copy the file example.txt on the remote host to my desktop on the local client over ssh.
– copy the file example2.txt on the local machine to the remote host over ssh.

that’s it for now 🙂
Toon

Advertisements