Linux下命令行截屏

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
vikyzhang
帖子: 677
注册时间: 2010-10-18 14:39
联系:

Linux下命令行截屏

#1

帖子 vikyzhang » 2010-11-29 13:08

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
Linux人社区开源新闻资讯翻译专版小编。翻译来自互联网上最新的英文开源资讯,提供给大家最迅即、最忠实于原文的开源业界动态、软件更新、有用技能等等。不至之处欢迎指正!xyxzfj@gmail.com
头像
tenzu
论坛版主
帖子: 36924
注册时间: 2008-11-21 20:26

Re: Linux下命令行截屏

#2

帖子 tenzu » 2010-11-29 13:26

下次看准了版块再发贴
头像
我就是我2
帖子: 1215
注册时间: 2008-12-13 10:55
来自: the Earth
联系:

Re: Linux下命令行截屏

#3

帖子 我就是我2 » 2010-11-29 13:26

:em20 就scrot命令的嘛
苏东坡问佛印道:“人人皆念观世音菩萨,观世音菩萨念谁?”
佛印答道:“念观世音菩萨。”
苏东坡诧异:“为何亦念观世音菩萨?”
曰:“求人不如求己。”


dropbox 誰好奇,誰來點
勞碌一生又如何,虛度一生又如何,你過得開心嗎?人活著就要開心嘛!
头像
dengxbin
帖子: 6
注册时间: 2010-11-26 12:49

Re: Linux下命令行截屏

#4

帖子 dengxbin » 2010-11-29 21:27

哇 还是不错的
头像
Sunmover
帖子: 2339
注册时间: 2010-05-24 13:02
来自: 星城长沙

Re: Linux下命令行截屏

#5

帖子 Sunmover » 2010-11-29 21:57

挺好的,大家学习学习。 :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,
回复