分页: 1 / 1

Linux下命令行截屏

发表于 : 2010-11-29 13:08
vikyzhang
Linux下命令行截屏
发表于:2010-11-28

很多Linux应用有专业的截屏功能。然而,不管是因为你想建立一个自动脚本,还是因为你习惯使用终端,如果你想用命令行实现截屏,那么请尝试:

import screenshot.jpg

你将可以使用鼠标选取一个矩形框。在你放下鼠标左键的那一刻,一个该矩形框的截屏会以import后面跟的文件名保存在当前目录下。
然后是scrot命令。

scrot -d 4 screenshot.png

它将对你整个桌面截屏,从执行命令到截下屏幕,中间间隔4秒。使用

scrot -c -d 4 screenshot.png

来显示出倒计时数。使用

scrot -q 80 -c -d 4 screenshot.jpg

来以80%质量保存jpg文件。

同时你也可以给scrot命令带上特殊的字符串,以产生包含日期和文件大小的截图文件名:

scrot ‘%Y-%m-%d_$wx$h.png’ -e ‘mv $f ~/Desktop/Pictures/’

以止命令将会在我电脑上产生一个名为“2010-11-28_2560×1024.png”的图像文件,并将它移动至我桌面上一个名叫Pictures的文件夹里面。

英文原文:http://tips4linux.com/take-screenshot ... he-command-line-in-linux/
转载请注明:Linux人社区 英文资讯翻译专版 编译
http://www.linux-ren.org/modules/newbb/ ... post319077

Re: Linux下命令行截屏

发表于 : 2010-11-29 13:26
tenzu
下次看准了版块再发贴

Re: Linux下命令行截屏

发表于 : 2010-11-29 13:26
我就是我2
:em20 就scrot命令的嘛

Re: Linux下命令行截屏

发表于 : 2010-11-29 21:27
dengxbin
哇 还是不错的

Re: Linux下命令行截屏

发表于 : 2010-11-29 21:57
Sunmover
挺好的,大家学习学习。 :em11
Ubuntu还可以使用gnome-screenshot命令来截图。。。呼呼
GNOME-SCREENSHOT(1) GNOME-SCREENSHOT(1)

NAME
gnome-screenshot - capture the screen, a window, or an user-defined
area and save the snapshot image to a file.

SYNOPSIS
gnome-screenshot [ -w ] [ -a ] [ -b ] [ -B ] [ -d SECONDS ] [ -e
EFFECT ] [ -i ] [ --display DISPLAY ]

DESCRIPTION
gnome-screenshot is a GNOME utility for taking screenshots of the
entire screen, a window or an user-defined area of the screen, with
optional beutifying border effects.

OPTIONS
-w, --window
Grab the current active window instead of the entire screen.

-a, --area
Grab an area of the screen instead of the entire screen.

-b, --include-border
Include the window border within the screenshot.

-B, --remove-border
Remove the window border from the screenshot.

-d, --delay=SECONDS,
Take the screenshot after the specified delay [in seconds].

-e, --effect=EFFECT,