Pastebinit: Uploading from the Command Line

One thing you will swiftly learn while trying to solve problems, learn how to do things, and generally share code in Linux, is that websites like and the like are very very useful. Cutting and pasting your code, or terminal output, or anything else, can get a bit boring though.

Enter Pastebinit, a handy little command-line tool that lets you upload a file, or pipe a terminal output, to a choice of different Pastebin websites.

It’s easy to install, if you have Ubuntu you can just pull it off the repositories:

sudo apt-get install pastebinit

You can either pass a file to it directly as an argument:

$ pastebinit /etc/X11/xorg.conf

or pipe output through it:

$ ps aux | pastebinit

It requires either a filename, or piped data, as an argument. The main options are -b [url of pastebin] and -a [author]. man pastebinit will show you a few more.

This tool is great for troubleshooting from the terminal, especially if you haven’t got access to a browser for some reason, or just generally for being lazy when sharing information. You can also use it if you’re working on some document in an editor, and you want to ask someone else for their opinion, eg for content checking. All in all, a very handy tool for the lazy!

Advertisements

1 Comment

Filed under Linux, Tips & Tricks

One response to “Pastebinit: Uploading from the Command Line

  1. Steve

    Another alternative to this, should pastebinit not be in your package manager, that you may want to try is “wgetpaste”.

    Does basically the same thing as pastebinit other than it defaults to rafb.net instead of pastebin (which is slow IMO anyway!)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s