I just had this quick idea to write a tcp port scanner in bash. Bash supports a special /dev/tcp/host/port file that you can read/write. Writing to this special file makes bash open a tcp connection to host:port. If writing to the port succeeds, the port is open, else the port is closed. At first I wrote this quick script. for port in {1..65535}; do echo >/dev/tcp/google.com/$port && echo "port $p