i=0;while :; do i=$(expr "$i" + 1); scrot "$i".png; sleep 2; done;

Take a screenshot every 2 seconds

Take a screenshot every 2 seconds and save it as a png file

1
2011-05-27 00:25:28

These Might Interest You

  • Take a screenshot, give $1 seconds pause to choose what to screenshot, then upload and get URI of post in ompdlr.org Show Sample Output


    0
    scrotit(){ echo "Screenshot in $1 seconds...";scrot -d $1 '%Y%m%d%h.png' -e 'curl -sF file1=@- http://ompldr.org/upload < $f | grep -P -o "(?<=File:).*(http://ompldr.org/.*)\<\/a\>";rm $f'| sed -r 's@.*(http://ompldr.org/\w{1,7}).*@\1@';}
    dzup · 2012-12-03 01:21:19 0
  • Requires ImageMagick. Takes a screenshot 5 seconds after it's run and saves it as desktop_screenshot.jpg Particularly handy when made into a menu option or button.


    9
    import -pause 5 -window root desktop_screenshot.jpg
    topher1kenobe · 2009-04-01 22:37:33 5
  • When connected to a box via ssh you can do a quick screenshot of that box using this command. After that you can rscp it over to your box and look at it. Show Sample Output


    5
    xwd -root -display :0.0| xwdtopnm | pnmtopng > Screenshot.png
    B4ckBOne · 2010-10-28 07:44:25 0
  • I often need to send screenshots to other people to explain settings and whatever. So I created this oneline which I use to create the screenshot with imagemagik, upload it via scp to my server and then the command opens an firefox tab with the screenshot. The screenshot can be a region or a window. You just have to replace the parts beginning with YOUR.


    2
    FILE="`date +%m%d%H%M%S`.png"; URL="http://YOUR_HOST/YOUR/PATH/$FILE"; TMP="/tmp/$FILE"; import -frame $TMP; scp $TMP YOUR-USER@YOUR-HOST:/YOUR/PATH/; rm $TMP; firefox "$URL"
    TheBunman · 2009-02-21 18:42:33 4

  • -5
    echo 00:29:36 | nawk -F: '{seconds=($1*60)*60; seconds=seconds+($2*60); seconds=seconds+$3; print seconds}'
    unixmonkey3280 · 2011-11-01 10:57:45 0
  • when using Gnome or KDE, you will have a hard time getting a screenshot of something like a login screen, or any other screen that occurs before the desktop environment is up and monitoring the printscreen key. (this probably applies for other DEs as well, but I haven't used them) What this command is meant to do is take a screenshot of an X window using a command you can run from your virtual terminals (actual text terminals, not just an emulator) To do this: Press CTRL+ALT+F1 to go to a virtual (text) terminal once your login window comes up Login to the virtual terminal and enter the command (you'll have to type it in) You should now have a file called screenshot.png in your home directory with your screenshot in it. For those of you who are new to the virtual terminal thing, you can use CTRL+ALT+F7 to get back to your regular GUI From http://www.gnome.org


    3
    chvt 7 ; sleep 2 ; DISPLAY=:0.0 import -window root screenshot.png
    camocrazed · 2010-08-20 17:28:49 1

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: