Take screenshots from the command line in Linux
2011-09-28 15:53
387 查看
There are many Linux applications dedicated to taking screenshots. However, you minght want to use the command line to do this, either because you want to build an automated script, or because you have a terminal screen handy.
import screenshot.jpg
This will allow you to select a rectangle using your mouse. The moment you let go of your left mouse button, a screenshot with the contents of that rectangle will be saved in the current directory.
And then there’s scrot.
scrot -d 4 screenshot.png
This will take a screenshot of your entire desktop, with a delay of 4 seconds between launching the command and saving the
screenshot.png file. Use
scrot -c -d 4 screenshot.png
to also display a countdown in the console. Use
scrot -q 80 -c -d 4 screenshot.jpg
to save a JPG file with a quality of 80%.
You can also use special strings with scrot, as to produce filenames that contain the date and size of the screenshot:
scrot ‘%Y-%m-%d_$wx$h.png’ -e ‘mv $f ~/Desktop/Pictures/’
The command above will produce a file named 2010-11-28_2560×1024.png on my system and move that file to to a folder called
Pictures, residing on my desktop.
import screenshot.jpg
This will allow you to select a rectangle using your mouse. The moment you let go of your left mouse button, a screenshot with the contents of that rectangle will be saved in the current directory.
And then there’s scrot.
scrot -d 4 screenshot.png
This will take a screenshot of your entire desktop, with a delay of 4 seconds between launching the command and saving the
screenshot.png file. Use
scrot -c -d 4 screenshot.png
to also display a countdown in the console. Use
scrot -q 80 -c -d 4 screenshot.jpg
to save a JPG file with a quality of 80%.
You can also use special strings with scrot, as to produce filenames that contain the date and size of the screenshot:
scrot ‘%Y-%m-%d_$wx$h.png’ -e ‘mv $f ~/Desktop/Pictures/’
The command above will produce a file named 2010-11-28_2560×1024.png on my system and move that file to to a folder called
Pictures, residing on my desktop.
相关文章推荐
- How to access Dropbox from the command line in Linux
- Take webpage screenshot from command line in Ubuntu Linux | Binary Tides
- Import data in a Lookup Definition from the command-line
- MYSQL 5.7 Linux脚本出现[Warning] Using a password on the command line interface can be insecure.
- How to monitor Nginx web server from the command line in real time
- Running a command on every machine in your domain from the command line
- [quote] How to determine what target is given in Makefile from the make command-line?
- The difference between && and ; in the Linux command line
- Running Your iOS App in the Simulator From The Command Line
- Spinlock annotations merged from the realtime tree to Linux mainline in 2.6.33
- the diary of sleep jobs & fg command line in linux
- How to download files from the Linux command line
- Xcode4: Running Application Tests From The Command Line in iOS
- [RT] Twitter from the command line in python using OAuth
- [SDK学习]Managing Projects from the Command Line
- 资源分享 | The Linux Command Line 的中文版
- OpenSSL: Generating an RSA Key From the Command Line
- Ubuntu Command-Line: Enable Unlimited Scrolling in the Terminal
- chapter2. Managing files from the command line
- the linux command line学习笔记之三