Embracing uniform resource identifier on the command line
Let's embrace a uniform resource identifier (URI) on the command line. An input-stream, for example, is created from a URI for redirection in a shell.
How do I search a web page on the command line?
1. Download a page with wget.
2. Use grep.
$ wget http ://www.jnode.org/
$ grep href < index.html
Why not download-and-grep a web page?
$ grep href < http ://www.jnode.org/
How do I display a web page on the command line?
$ cat < http ://www.jnode.org/
How do I display the md5sum of a document?
$ md5sum < http ://www.jnode.org/
How do I download-and-uncompress an archive?
$ gunzip < http ://www.jnode.org/demo.tar.gz | tar x
How do I display the contents of a resource inside a jar?
$ cat < jar:demo.jar!/license.txt
The URI provides an alternative syntax for local files, too.
$ cat < in.txt
is equivalent to
$ cat < file :/in.txt
- Login to post comments
URL support
There was limited support for URLs for commands like cat and cp in the past and I think it would be handy to allow the usage of URLs again where it makes sense.