gnome-screenshot is a command-line utility that allows you to capture screenshots of the screen, a window, or a user-defined area, and save the image to a file. It is a part of the GNOME desktop environment and can be used to quickly and easily take screenshots without the need for a separate graphical application.
With gnome-screenshot, you can capture the entire screen, a specific window, or a user-defined area by selecting the rectangular region to be captured. It also allows you to take screenshots with a delay, allowing you to set a timer before the screenshot is taken. This can be useful for capturing screenshots of menus or other elements that may disappear when the screenshot is taken.
Once the screenshot is taken, gnome-screenshot will save the image to a file in the user’s home directory, with a default name of Screenshot-[year]-[month]-[day]-[hour]-[minute]-[second].png. The format of the file can be changed to jpg, gif or bmp by passing the appropriate flag.
The basic syntax for taking a screenshot is:
# gnome-screenshot [options]
If you encounter the below error while running the command gnome-screenshot:
gnome-screenshot: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install gnome-screenshot |
Ubuntu | apt-get install gnome-screenshot |
Arch Linux | pacman -S gnome-screenshot |
Kali Linux | apt-get install gnome-screenshot |
CentOS | yum install gnome-screenshot |
Fedora | dnf install gnome-screenshot |
Raspbian | apt-get install gnome-screenshot |
gnome-screenshot Command Examples
1. Take a screenshot and save it to the default location, normally `~/Pictures`:
# gnome-screenshot
2. Take a screenshot and save it to the named file location:
# gnome-screenshot --file path/to/file
3. Take a screenshot and save it to the clipboard:
# gnome-screenshot --clipboard
4. Take a screenshot after the specified number of seconds:
# gnome-screenshot --delay 5
5. Launch the GNOME Screenshot GUI:
# gnome-screenshot --interactive
6. Take a screenshot of the current window and save it to the specified file location:
# gnome-screenshot --window --file path/to/file
7. Take a screenshot after the specified number of seconds and save it to the clipboard:
# gnome-screenshot --delay 10 --clipboard
8. Display the version:
# gnome-screenshot --version