Tech Tip: TCP/IP Access Using bash
Most of us default to wget, curl, netcat and others when in need of network data from the commandline, not knowing, or perhaps forgetting, that bash often provides the support that we need using redirection from /dev/proto/host/port.
$ cat </dev/tcp/time.nist.gov/13 55103 09-09-29 17:58:55 50 0 0 0.0 UTC(NIST) *
Reads the time in Daytime Protocol (RFC-867) from the NIST Internet Time Service server (documented at tf.nist.gov/service/its.htm).
The Advanced Bash-Scripting Guide includes some more involved examples in chapter 27, covering sending a protocol request, getting web pages, and even UDP use.
Editor's Note: If this does not work for you, make sure to read the comments below, this option is not enabled on all distros (among them, some versions of Ubuntu).
- An Introduction to Tabled Logic Programming with Picat
- Ubuntu MATE, Not Just a Whim
- Build Your Own Raspberry Pi Camera
- Nasdaq Selects Drupal 8
- Non-Linux FOSS: Screenshotting for Fun and Profit!
- Secure Desktops with Qubes: Compartmentalization
- Canonical Ltd.'s Ubuntu Core
- A New Mental Model for Computers and Networks
- Getting a Windows Refund in California Small Claims Court
- The Peculiar Case of Email in the Cloud