How to install tar.gz file directly from URL efficiently from terminal? Suppose we have a web url to a .tar.gz file. 

We could download it, unzip/tar it, and install it. 

Is there an elegant way of doing all of the above from terminal, preferably with a one-liner? 

Example tar.gz file: https://cran.r-project.org/src/base/R-3/R-3.5.0.tar.gz

Note: I don't mind using a program to do this, but much prefer everything done from the terminal, mostly for efficiency, fewer steps, and being able to give reproducible instructions to others
If you don't want to keep the tar file, do

curl https://cran.r-project.org/src/base/R-3/R-3.5.0.tar.gz | tar zxf -


This uncompresses and extracts the tar file while downloading it.

The commands to install vary with the package, but you can do this after the download has finished:

cd R-3.5.0 ; ./configure &amp;&amp; make