There is no quick terminal method to install gsl. The best tutorial for installation I've found is here:
Once you have done all the steps in the tutorial it would be nice to not have to type
-I/home/user/.... There are a few ways to do this, one way is to make an alias for gcc but I wouldn't recommend it.
I think the best way is to move the include files and the lib files to their appropriate directories. To move the include files type:
sudo cp -r /home/yourname/gsl/include/gsl/ /usr/include/
where "yourname" is the name you used for the install (the one in the tutorial).
To move the library files I used:
sudo cp /home/yourname/gsl/lib/libgsl* /usr/lib/
sudo cp /home/yourname/gsl/lib/pkgconfig/gsl.pc /usr/lib/pkgconfig/
This should work on most ubuntu installations (at least it worked on my 16.04 64 bit installation) and you should be able to compile without the use of the I and L flags.
Update : Ever since ubuntu 18.04, more modern versions of GSL are installed using the default command:
sudo apt-get install libgsl-dev
Once you do this you can run your program with:
g++ -std=c++1X <your_program>.cpp -o <output_name> -lgsl -lgslcblas -lm