[HowTo] Use public command-line pastebin services without installing anything!

Introduction

Sometimes we might want to easily share terminal output.

While this can be accomplished directly in the forums or manually through websites like pastebin, there also exist a number of open services that allow you to paste and share directly from the command line by using tools you already have installed.

This is great for many situations, including troubleshooting from a non-graphical boot, or simply very large outputs. Here I will share a few examples and how to use them.


Services and Examples

0x0.st

<command> | curl -F 'file=@-' https://0x0.st

Paste69

<command> | curl -i -F'file=@-' https://0x45.st

rocket paste

<command> | curl --data-binary @- https://paste.rs

paste.c-net.org

<command> | curl -s --data-binary @- 'https://paste.c-net.org/'

clbin.com

<command> | curl -F 'clbin=<-' https://clbin.com


Aliases and other tricks

To quasi-install paste.c-net.org pasting and sharing add the following to your bashrc (zshrc untested):

paste.cnet.org .bashrc
pastenet()
{
    local url='https://paste.c-net.org/'
    if (( $# )); then
        local file
        for file; do
            curl -s \
                --data-binary @"$file" \
                --header "X-FileName: ${file##*/}" \
                "$url"
        done
    else
        curl -s --data-binary @- "$url"
    fi
}
pasteget()
{
    local url='https://paste.c-net.org/'
    if (( $# )); then
        local arg
        for arg; do
            curl -s "${url}${arg##*/}"
        done
    else
        local arg
        while read -r arg; do
            curl -s "${url}${arg##*/}"
        done
    fi
}

Then you can use ‘pastenet’ and ‘pasteget’ a few ways:
<command> | pastenet to share output.
pastenet <filepath> <filepath2> to share file(s). 50M limit.
pasteget https://paste.c-net.org/<exampleurl> to download paste.c-net shared content.


Graveyard

Click to view services previously listed here but no longer available.

ix.io

<command> | curl -F 'f:1=<-' ix.io

rustypaste

<command> | curl -F 'file=@-' https://rustypaste.shuttleapp.rs

paster .bashrc
paster()
{
    local url='https://rustypaste.shuttleapp.rs'
    if (( $# )); then
        local file
        for file; do
            curl -F "file=@""$file""" "$url" 
        done
    else
        curl -F 'file=@-' "$url"
    fi
}

Then you can use paster:
<command> | paster to share output.
paster <filepath> <filepath2> to share file(s).

sprunge.us

<command> | curl -F 'sprunge=<-' http://sprunge.us


Notes and Warnings

  • More detailed info found at each host, including options like expiration time and more.
  • Further stipulations, privacy clauses, and the like can be found at each project host.
  • Do not abuse these services. They are made freely available, so dont knock a good thing.
  • Remember to avoid sharing personal information.
    (see this related page for tips: [HowTo] Provide System Information)
21 Likes