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