Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't like the GUI way of taking screenshot,uploading it to imgur and get the uploaded link.

So what can I do to take a screenshot of my Ubuntu desktop, upload the screenshot to and then get back the uploaded link from terminal?

All I have to do from terminal.

share|improve this question
up vote 10 down vote accepted

Take the screenshot of your desktop

gnome-screenshot was the default command-line tool on Ubuntu to take a screenshot.

gnome-screenshot -d 10

Delayed the screenshot action by 10 seconds,So that you can place the desired window on front within 10 seconds.The taken images are actually stored in ~/Pictures folder.

Upload the image to

gedit ~/.bashrc

Add the below lines to the opened .bashrc file and then save it.

imgur() {
    for i in "$@"; do
        curl -# -F "image"=@"$i" -F "key"="4907fcd89e761c6b07eeb8292d5a9b2a"|\
        grep -Eo '<[a-z_]+>http[^<]+'|sed 's/^<.\|_./\U&/g;s/_/ /;s/<\(.*\)>/\x1B[0;34m\1:\x1B[0m /'

Source the .bashrc file,so that the changes can take effect,

source ~/.bashrc

The above script requires curl package to work.So install it by running

sudo apt-get install curl

Then run the below command to upload the image stored in the ~/Pictures folder to,

imgur ~/Pictures/filename.png

Get the link of uploaded image

enter image description here


share|improve this answer
@user11153 are you sure? – Avinash Raj Jul 26 '14 at 15:19
I tested both versions locally: old version from your post didn't work (grep was reporing syntax error) and version posted on forum - that you linked as "Source" - worked flawlessly for me. – user11153 Jul 26 '14 at 15:51

If you are using Xubuntu the xfce4-screenshooter-plugin app for the xfce toolbar allows you to link a screenshot to zimagez , as illustrated at - but you must register for an account there to use it (free and spamfree).

share|improve this answer

Probably this is what you are looking for. It is more or less the same concept than your own response, but scripted in order to make it really silly and simple.

Use Snap-Share

There is a script called Snap-Share that was ment to feel what you are looking for. What it does exactly? well...

0) Launch it:

1)it takes a picture

2)upload it, and

3) copy the link in your clipboard. All in one move.

See Snap-share working:

In this video you can see how to install the program and how it works :)

Click the image to go to the video! Snap-share video

How to install it:

sudo apt-get install xsel scrot xclip

and then paste this:

mkdir -p ~/.snap-share-install && cd ~/.snap-share-install && wget && unzip && rm &&  cd snap-share-master/ &&  chmod +x && sh && cd ~ && clear

Then run it with your favourite launcher. The application is called snap-share. :)

Hope it is useful.

Note. this was made mainly for personal use, it is an alpha version. I don't why but randomly from time to time (not allways) the link is mixed with some other things in the clipboard if you take more than three snaps, I don't know why or how to solve it yet. Any help appreciated.

Project Page:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.