How to Take Terminal Screenshot in Ubuntu

How to Take Screenshot of Terminal in Ubuntu

Sometimes we need to capture our screen contents while using Ubuntu Linux. This is mainly required in case of troubleshooting or if you want to communicate your screen’s present information to others, or save it for yourself for later use. There are many tools available to take screenshot in Ubuntu, but they mostly work in desktop environment. Sometimes you may need to take screenshot of terminal in Ubuntu. In this article, we will learn how to take screenshot of terminal in Ubuntu.

How to Take Screenshot of Terminal in Ubuntu

Here are some of the simple ways to take screenshot of terminal in Ubuntu.

1. Using Print Screen Button

Most keyboards these days contains a readymade button called PrtScn in the topmost row, on right hand side. It stands for Print screen. When you press that key, your PC/laptop will automatically capture a screenshot and save it to clipboard. You can paste it in any image editor and save the resultant file as per your requirement.

Pressing PrtScn button alone will take screenshot of entire visible screen. If you want to take screenshot of only the active window then press Alt+PrtScn buttons together.

One of the advantages of this method is that since the image is stored in clipboard, and you can paste it any image editor, you are free to save it in any format you want, after you edit it as you need.

2. Using gnome-screenshot

You can also use gnome-screenshot to quickly take a screenshot of your terminal. Here are the commands to install it on your system.

$ sudo apt-get update -y

$ sudo apt-get install -y gnome-screenshot

Just run the following terminal command to take a screenshot of your system.

$ gnome-screenshot

It provides many useful options which you can read more about using the following command.

$ gnome-screenshot --help

For example, if you want to delay your screenshot by 10 seconds, run the following command.

$ gnome-screenshot -d 10

These screenshots are saved in ~/Pictures directory.

3. Using Import Command

You can also use ImageMagick library’s import command. ImageMagick is a well-known library for image editing. Here is the command to install it on your system.

$ apt-get install imagemagick

Here is the command to capture screenshot using import command.

$ import screenshot.png

Import command provides many useful options to edit your screenshot. Here is a command to capture entire screen shot after delay and resize it.

$ import -window root -resize 400x300 -delay 200 screenshot.png

4. Using shutter

Shutter is also another popular program that allows you to easily take screenshot from terminal. Here is the command to install shutter.

$ sudo add-apt-repository ppa:shutter/ppa
$ sudo apt-get update
$ sudo apt-get install shutter

Here is the command to take screenshot of active window.

$ shutter -a -o shot.png -e

Here is the command to take screenshot of entire display.

$ shutter -f -o shot.png -e

In this article, we have learnt several simple ways to quickly take screenshot of terminal and even entire display using terminal commands. You can also use these commands within shell scripts if you want to automate them. Alternatively, if you want to regularly take screenshots, you can even use them in cronjobs.

Also read:

Difference Between null=True and blank=True in Django
How to Split String By Character in JavaScript
How to Stop SetInterval Call in JavaScript
How to Enable PPP in Ubuntu
How to Encrypt Disk in Ubuntu After Install

Leave a Reply

Your email address will not be published. Required fields are marked *