Команда at linux скриншоты

What is the terminal command to take a screenshot?

What command(s) can I use in the terminal that’s equivalent to the PrtSc (Print Screen) button? I am running Ubuntu GNOME.

Are you using gnome or KDE or something else? It kind of depends of what desktop environment you are using.

8 Answers 8

You can use the import tool available in the ImageMagick package (you need to install this if it’s not already available on your system).

Then run the following command in a shell:

and select the window you want to capture or select a region by pressing the left mouse button and dragging.

import is a actually a very powerful command which can be used in many ways to capture the screen. For example, to capture the entire screen after some delay and resize it, use the following command:

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

To see all the available options with the import command, go to ImageMagick’s website.

Another way to take a screenshot from the terminal is with scrot .

sudo apt-get install scrot 

To take a screenshot in Linux from the terminal with scrot run:

Some more options with scrot are here:

scrot -b -d 5 '%Y:%m:%d:%H:%M:%S.png' -e 'mv $f ~/Desktop/' 
  • -b specifies that the screenshot should include the window borders.
  • -d specifies a delay of five seconds.
  • ‘%Y:%m:%d:%H:%M:%S.png’ will save the screenshot with a name based on the current date and time with the format specified, .png in this case.
  • -e ‘mv $f ~/Desktop/’ tells scrot to save the screenshot on the Desktop .

Based on @jack’s comment: If you want to take a screenshot of a remote machine via an SSH session then you can do that by setting the DISPLAY environment variable to the display, like so:

DISPLAY=:0 scrot MyScreenshot.png 

This certainly works for many users, it just didn’t work for me. ImageMagick import renders KDE Desktop Effects transparent window borders / glow effect in solid black. And scrot doesn’t want to participate in pipes at all, which I use to avoid unnecessary intermediate files when cropping the desired screen from a Xinerama setup. I use xwd instead and use ImageMagick convert to convert the xwd-format to PNG and do the cropping. (See also my answer below)

@That Brazilian Guy Every graphic command uses DISPLAY env variable to know to which X server connect. If running on ssh just export DISPLAY=:0 (or proper value) before issuing the command

Open a terminal by pressing Ctrl + Alt + T and run:

Читайте также:  Linux debian файлы конфигурации

Use gnome-screenshot -d xx to delay the action. For example, to delay the screenshot action by 10 s:

Screenshots are placed under ~/Pictures

You can use shutter program to take screenshot from terminal.Run the below commands in terminal to install shutter,

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

To take a screenshot of active window,

To take a screenshot of whole display,

The screenshots taken are stored in the home directory.

For more options run shutter —help command,

Usage: shutter [options] Options: Example 1 shutter -a -p=myprofile --min_at_startup Example 2 shutter -s=100,100,300,300 -e Example 3 shutter --window=.*firefox.* Example 4 shutter --web=http://shutter-project.org/ -e Capture Mode Options: -s, --select=[X,Y,WIDTH,HEIGHT] Capture an area of the screen. Providing X,Y,WIDTH,HEIGHT is optional. -f, --full Capture the entire screen. -w, --window=[NAME_PATTERN] Select a window to capture. Providing a NAME_PATTERN (Perl-style regex) ist optional. -a, --active Capture the current active window. --section Capture a section. You will be able to select any child window by moving the mouse over it. -m, --menu Capture a menu. -t, --tooltip Capture a tooltip. --web=[URL] Capture a webpage. Providing an URL ist optional. -r, --redo Redo last screenshot. Settings Options: -p, --profile=NAME Load a specific profile on startup. -o, --output=FILENAME Specify a filename to save the screenshot to (overwrites any profile-related setting). Supported image formats: You can save to any popular image format (e.g. jpeg, png, gif, bmp). Additionally it is possible to save to pdf, ps or svg. Please note: There are several wildcards available, like %Y = year %m = month %d = day %T = time $w = width $h = height $name = multi-purpose (e.g. window title) $nb_name = like $name but without blanks in resulting strings $profile = name of current profile $R = random char (e.g. $RRRR = ag4r) %NN = counter The string is interpretted by strftime. See "man strftime" for more examples. As an example: shutter -f -e -o './%y-%m-%d_$w_$h.png' would create a file named '11-10-28_1280_800.png' in the current directory. Application Options: -h, --help Prints a brief help message and exits. -v, --version Prints version information. -d, --debug Prints a lot of debugging information to STDOUT. --clear_cache Clears cache, e.g. installed plugins, at startup. --min_at_startup Starts Shutter minimized to tray. --disable_systray Disables systray icon. -e, --exit_after_capture Exit after the first capture has been made. This is useful when using Shutter in scripts. 

Источник

Какова команда терминала, чтобы сделать скриншот?

Какие команды можно использовать в терминале, что эквивалентно кнопке PrtSc (Print Screen)?

9 ответов

Нашел эту опцию здесь и другие опции также перечислены.

Откройте терминал, нажав Ctrl + Alt + T и введите

используйте gnome-screenshot -d xx, чтобы отложить действие.

Отложить действие скриншота на 10 секунд

Читайте также:  Post it application linux

Вы можете использовать инструмент импорта, доступный в пакете ImageMagick (его необходимо установить, если он уже не доступен в вашей системе).

Запустите следующую команду в оболочке:

и выберите окно, которое вы хотите захватить или выберите регион, нажав левую кнопку мыши и перетащив.

На самом деле import — очень мощная команда, которая может быть использована многими способами для захвата экрана. Например, чтобы захватить весь экран и после некоторой задержки и изменить его размер, используйте следующую команду:

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

Чтобы увидеть все параметры, доступные в команде импорта, перейдите на веб-сайт ImageMagick.

Еще один способ сделать скриншот из терминала с помощью scrot

sudo apt-get install scrot 

Чтобы сделать снимок экрана в Linux с терминала типа scrot:

Еще несколько вариантов с scrot здесь:

scrot -b -d 5 '%Y:%m:%d:%H:%M:%S.png' -e 'mv $f ~/Desktop/' 
  • -b указывает, включая границы окна
  • -d указывает задержку в пять секунд
  • «%Y:%m:%d:%H:%M:%S.png» сохранит снимок экрана с именем на основе текущей даты и времени и в указанном формате, .png в этом случае
  • -e ‘mv $f ~/Desktop/’ говорит мошеннику сохранить скриншот на рабочий стол

Вы можете использовать программу затвора, чтобы сделать снимок экрана с терминала. Для установки затвора выполните следующие команды в терминале,

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

Чтобы сделать скриншот активного окна,

Чтобы сделать скриншот всего дисплея,

Сделанные скриншоты хранятся в домашнем каталоге.

Для большего количества вариантов запустите shutter —help команда,

Usage: shutter [options] Options: Example 1 shutter -a -p=myprofile --min_at_startup Example 2 shutter -s=100,100,300,300 -e Example 3 shutter --window=.*firefox.* Example 4 shutter --web=http://shutter-project.org/ -e Capture Mode Options: -s, --select=[X,Y,WIDTH,HEIGHT] Capture an area of the screen. Providing X,Y,WIDTH,HEIGHT is optional. -f, --full Capture the entire screen. -w, --window=[NAME_PATTERN] Select a window to capture. Providing a NAME_PATTERN (Perl-style regex) ist optional. -a, --active Capture the current active window. --section Capture a section. You will be able to select any child window by moving the mouse over it. -m, --menu Capture a menu. -t, --tooltip Capture a tooltip. --web=[URL] Capture a webpage. Providing an URL ist optional. -r, --redo Redo last screenshot. Settings Options: -p, --profile=NAME Load a specific profile on startup. -o, --output=FILENAME Specify a filename to save the screenshot to (overwrites any profile-related setting). Supported image formats: You can save to any popular image format (e.g. jpeg, png, gif, bmp). Additionally it is possible to save to pdf, ps or svg. Please note: There are several wildcards available, like %Y = year %m = month %d = day %T = time $w = width $h = height $name = multi-purpose (e.g. window title) $nb_name = like $name but without blanks in resulting strings $profile = name of current profile $R = random char (e.g. $RRRR = ag4r) %NN = counter The string is interpretted by strftime. See "man strftime" for more examples. As an example: shutter -f -e -o './%y-%m-%d_$w_$h.png' would create a file named '11-10-28_1280_800.png' in the current directory. Application Options: -h, --help Prints a brief help message and exits. -v, --version Prints version information. -d, --debug Prints a lot of debugging information to STDOUT. --clear_cache Clears cache, e.g. installed plugins, at startup. --min_at_startup Starts Shutter minimized to tray. --disable_systray Disables systray icon. -e, --exit_after_capture Exit after the first capture has been made. This is useful when using Shutter in scripts. 

Источник

Читайте также:  Zoiper для linux mint

compizomania

Большинство пользователей компьютера знают, что делать скриншоты или снимки экрана можно с клавиатуры. Нажатие клавиши Print, делает снимок всего рабочего стола, а сочетание клавиш Alt+Print — снимок активного окна.
В большинстве дистрибутивах Linux установлена по умолчанию для этой цели графическая утилита Снимок экрана, в которой также можно выбрать одно из выше описанных действий, нажать кнопку Сделать снимок экрана и снимок готов.
Но не многие пользователи Linux знают о том, что все эти действия и даже больше, можно выполнять с помощью командной строки или терминала.

1. Снимок Рабочего стола

Откройте терминал, введите и выполните следующую команду:

Выполнение данной команды сделает скриншот всего рабочего стола и спросит вас, куда сохранить его:

2. Выбор области захвата

Если вы хотите сделать скриншот определенной области, выполните следующую команду:

Это позволит превратить курсор мыши в перекрестье, которым можно выбрать нужную область, чтобы сделать скриншот.

3. Снимок собственного окна терминала

Выполните следующую команду:

Кроме того, если вы хотите сделать снимок без границ окна, то выполните следующую команду:

Вы также можете добавить задержку на выполнение снимка с тем, чтобы иметь возможность в это время открыть меню или какое-то окно.

5. Снимок активного окна с задержкой

Выполните следующую команду:

gnome-screenshot -w -d 5 & exit

Цифру 5 (секунды) вы можете изменить на своё усмотрение, чтобы увеличить или уменьшить время задержки для открытия нужного окна, а команда exit после разделительного знака команд — &, закроет терминал и будет сделан снимок.

6. Добавление эффектов к снимкам

Следующая команда добавляет тени вокруг окна терминала:

gnome-screenshot -w -e shadow

Эта команда добавляет тени вокруг активного окна с задержкой и закрытием терминала:

gnome-screenshot -w -e shadow -d 5 & exit

А также можно добавить чёткие границы окна с помощью следующих команд:

gnome-screenshot -w -e border

gnome-screenshot -w -e border -d 5 & exit

gnome-screenshot -e border -d 5 & exit

P.S. Теперь фанаты терминала могут делать снимки с помощью командной строки.

Источник

Оцените статью
Adblock
detector