Pasty Bins - How to Pipe Command Line Output to a Pastebin

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, which offers the simplest and most effective way of sharing information via the commandline.

Command Line Output to Pastebin

Relying on allows us to stay clean and light. And it simplifies the sharing process over operating systems, as all that is required is curl.

The command to paste output from the command line:

curl -F 'sprunge=<-'

The input you want to share needs to be piped to the curl command. In this case it will be a simple .txt file.

$ cat myfile.txt | curl -F 'sprunge=<-'

The returned URL is where the paste can be found.

An alias further allows you to simplify the command, only having to type sppaste.

alias sppaste="curl -F 'sprunge=<-'"

If you want to make the alias persistent, add it to the .bashrc file in your home directory.

References and Further Reading