Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-20-2007, 10:54 AM   #1
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
how to take snapshot in linux from terminal

I want to take a screen shot on a linux terminal by a shell script and also want this script to be run by a php script is there any way to do this
Old 11-20-2007, 11:52 AM   #2
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
When you say screen shot, do you mean text-mode screen dump (i.e. a text file containing what is visible on the tty), or a graphical screenshot?

Is the PHP interpreter running in the terminal, or as a separate process (e.g. run by a web server?)

Assuming the answer to those question are "graphical" and "separate process", here's how to do it:

The traditional X-Windows way to save a screenshot of a window is with the xwd program. Usually this program has the user select the window to dump using the mouse, but you can also specify it using the X window ID.

The overview of the process is therefore like this:
  • Get the window-id of the terminal
  • Call xwd for the window-id
  • Post process dump file (e.g. translate to a format like png)

The trick will be getting the window-id...


screenshot, xwindows

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
snapshot of installation open diameter on linux redhat 9 tufailfifa Programming 1 12-19-2006 08:00 AM
LXer: Snapshot of the embedded Linux market -- May, 2006 LXer Syndicated Linux News 0 05-27-2006 04:21 AM
How to snapshot and restore Linux? yitzhakbg Linux - Software 0 12-14-2004 10:37 AM
Linux - File Snapshot-Tool kgk Linux - General 2 08-14-2003 03:30 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration