Pastebins come in handy, when you need to share text or code quickly. For a hacker, it is even more useful to be able to directly share output from the command line to a pastebin.
In this case, we will look at sprunge.us, which offers the simplest and most effective way of sharing information via the commandline.
Command Line Output to Pastebin
Relying on sprunge.us allows us to stay clean and light. And it simplifies the sharing process over operating systems, as all that is required is
The command to paste output from the command line:
curl -F 'sprunge=<-' http://sprunge.us
The input you want to share needs to be piped to the curl command. In this case it will be a simple
$ cat myfile.txt | curl -F 'sprunge=<-' http://sprunge.us http://sprunge.us/UGPG
The returned URL is where the paste can be found.
An alias further allows you to simplify the command, only having to type
alias sppaste="curl -F 'sprunge=<-' http://sprunge.us"
If you want to make the alias persistent, add it to the
.bashrc file in your home directory.