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:
<command> | curl -F 'file=@-' https://0x0.st
<command> | curl --data-binary @- https://paste.rs
<command> | curl -F 'file=@-' https://rustypaste.shuttleapp.rs
<command> | curl -s --data-binary @- 'https://paste.c-net.org/'
<command> | curl -F 'clbin=<-' https://clbin.com
<command> | curl -F 'f:1=<-' ix.io
<command> | curl -F 'sprunge=<-' http://sprunge.us
Aliases and other tricks:
To quasi-install rustypaste pasting and sharing add the following to your bashrc (zshrc untested):
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).
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.
Notes and Warnings
- There is more detailed info at each host, including options like setting expiration time and more.
- Please dont abuse these services. They are made freely available, so dont knock a good thing.
- Further stipulations, user and privacy clauses and the like can be found at each project host.
- Remember to avoid sharing personal information.
(see this related page for tips: [HowTo] Provide System Information)