Take Screenshots in Linux with “scrot”
I have found this tool recently, and I have no idea how I was able to manage without it before.
This tool allows you to capture any region of your screen, by selecting it with your mouse, clicking on the title-bar of a window and other methods. It’s very flexible and contains many options.
To download the program in Ubuntu:
sudo apt-get install scrot
Now, open a new text file and type this
1
2 #!/bin/bash
scrot "/home/YourUsername/Desktop/screenshot`date +%d_%m_%y_%H_%M_%S_%N`.png" -s -q '85'
Don’t forget to replace YourUsername with your actual username. We’ll assume that you called the file “scrshot”
This script will call scrot, will tell it to save the screenshots on your desktop with names similar to screenshot14_11_08_00_36_41_278273217.png (I know the name looks ugly, but I love this nomenclature because it prevents file name conflicts). The -s flag is for “Select”: This will allow you to select any area/window with your mouse. The -q flag is for “Quality”: In the above script I set it to 85%, which is good enough. Note that increasing the quality will also increase the file size.
Now, make the file executable:
chmod +x scrshot
Add a new launcher to you gnome panel, give it a suitable name and let it execute the above script. (i.e., in the “Command” field, enter the path to the script, eg. /home/YouName/scripts/scrshot or wherever you saved it).
No taking a screenshot is easy: Click the launcher, select a region, and go to your desktop to collect the resulting file.
Actually, scrot is more powerful than described in this post, one of its strong features is adding a delay so the script will wait for a given number of seconds before taking the screenshot.
For more options refer to the manual pages:
If you enjoyed this post, make sure you subscribe to my RSS feed!man scrot
No related posts.
9 Comments to Take Screenshots in Linux with “scrot”
Trackbacks/Pingbacks
[...] Take Screenshots in Linux with scrot – Fantastic little tool for taking screenshotstags: linux ubuntu howto [...]
Leave a Reply
About Me
Tags
Categories
- Algorithms
- Bash
- BlackBerry
- Collaboration
- Command Line
- Cool Tricks
- Easter Eggs
- Ebooks
- Firefox
- Hardware
- Humor
- iPhone
- Linux
- Linux Development
- Linux Kernel
- Networks
- Open Knowledge
- Other
- Productivity
- Programming
- Regular Expressions
- Science
- Security
- Shell Scripts
- Short Posts
- Social Networks
- Thoughts
- Tools
- Vim
- Web Development
- Websites
Popular Posts
Calendar
Archives
- September 2010 (1)
- August 2010 (2)
- July 2010 (5)
- June 2010 (1)
- May 2010 (1)
- April 2010 (3)
- March 2010 (1)
- January 2010 (1)
- December 2009 (2)
- September 2009 (13)
- July 2009 (1)
- June 2009 (6)
- May 2009 (4)
- March 2009 (18)
- February 2009 (10)
- January 2009 (10)
- December 2008 (7)
- November 2008 (8)
- October 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (2)

I just try to pass from windows to linux and in Windows there was a tool that i use frequently and it was for me very important: Fscapture.
In this little time i have searched for a equivalent in Ubuntu, that can take a screenshot from the desktop ( in particular a region of the screen,gnome it can’t)and save automatically the image in my desktop….
This is the solution!!!!
Thank You very much Amir u are a Genius!
Now i will link your script with the shortcut ptrscr & prtscr+alt u can help me?
P.S Scuse me for my English: I’m Italian
Happy that you found it useful. And thank you for your comment
Hi Amir,
I will to complete my work if u can help me
In my previously Reply i said u that i would like to link your script to
a shortcut key.
I read this post
http://www.systembeta.com/html/Linux/200809/12-482.html
and i resolve the problem with the stamp of all the desktop
(i have disable gnome-screenshot shortcuts)
but i can’t use the option -s in scrot using keybinding_commands…
can u tell me why and can u have a solution for me?
thank u very much
Hi Bellerofonte,
Thanks again for your comment. I’m sorry, I didn’t notice your question in the previous comment (my bad).
I’ll look at your issue, but I can’t promise to do this soon since I have exams next week. If you find a solution before me please share it with us.
Thank you
Hi Amir,
what about Gscrot?
I can install it with scrot?
Hi
I don’t know what is Gscrot. If it exists then I think it might be a graphical frontend for scrot?
http://gscrot.ubuntu-projekte.de/
It’s not a frontend for scrot anymore, so it’ll be renamed to “Shutter” soon.
Thank you Vadim for your comment.