Are there any command line tools on Linux that allow you to post output from commands or text files directly to a sharing service such as pastebin.com?
There are several services that provide this but 2 that are pretty easy to use from the command line are
NOTE: This is a Fedora/CentOS/RHEL only option
If you're using any of the Red Hat based distros you can install the package
For basic posting of a single text file you can do the following.
The above command will return a URL where your content can now be accessed by others.
There are of course a whole host of other options.
See the man page,
This is probably the more popular of the 2 tools. It's supported on most of the distros I frequent such as Fedora, CentOS, and Ubuntu just to name a few. It has similar features to
list of services
For starters we can get a list of all the "supported" URLs via the
If you don't bother to select one using the
Posting a simple text file
To post a sample file to
You can also tell that the content you're pasting is code using the
A full list of syntax's supported, is covered in the pastebin.com FAQ under this topic titled: For which languages do you offer syntax highlighting?.
For further details be cure to check the man pages,
Here are 2 examples of the file that I posted to each service.
fpaste - http://ur1.ca/gddtt
pastebin - http://pastebin.com/jGvyysQ9
I like the two command line tools that use
You can make a simple function to save you having to remember the gory details, like so:
You can send to an enhanced URL if you would like syntax highlighting for your code paste. For ix, you append either
For http://sprunge.us, append
I needed something to share terminal output even when X server wasn't loaded so I created this service: termbin.com. The only thing you need is netcat, then you can easily share with anyone anything that can be shown in terminal, there's example:
After running this command you'll get in response url address with text file.
To make your life easier you can add such alias to your .bashrc file:
Now sharing will be much simplier:
You can get saved ones for example by using curl. You'll find more examples on termbin.com.
You can host your own server as well, there is github repository: https://github.com/solusipse/fiche. If you want to make it private, don't forget to set whitelist parameter.