How to record screen on Linux from command line

Using just FFMPEG!

Often, during various kind of activities in front of a monitor, you need to record the screen.
This operation can be accomplished using various tools, most with a graphical interface.

But is also possible to record the screen from command line, using a tool usually already installed on your linux box: ffmpeg

What is FFMPEG?

FFmpeg is a suite of libraries and programs for handling video, audio, and other multimedia files and streams, published under the GNU Lesser General Public License 2.1+ (or GNU General Public License 2+ , depending on which options are enabled).

The name of the project is inspired by the MPEG video standards group, together with “FF” for “fast forward” (

If ffmpeg is not already present in your linux, you can simply install it using the package system.

For example, on Debian/Ubuntu:

sudo apt-get install ffmpeg

Let’s start recording!

Once installed ffmpeg, you are able to start screen recording with this simple command:

ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -qscale 0 recording.mpg

Hit CTRL+C when you need to stop the recording (saved in recording.mpg)

Related posts

  1. How to extract forensic artifacts from Linux swap
  2. Technology Roundup #18
  3. Linux Forensics: Memory Capture and Analysis
  4. Cybersecurity Roundup #15
  5. Why Huawei USB stick setup on linux adds a strange “Huawei Autorun” script in system start?