Quickly Share Code From Your Mac/Linux Terminal

Add this alias to bash_aliases:

On Mac:

alias share=’curl –sF “sprunge=<-” http://sprunge.us | pbcopy && pbpaste

On Linux:

alias share=’curl -sF “sprunge=<-” http://sprunge.us | xclip’

 

Now open a terminal, and run something like:

cat mycode.c | share

Your code is now in the internet, and the url is in your clipboard.

Leave a Reply