23

The terminal is where everything gets done in linux.

So if this is true, how can I play an AVI video (.avi extension) from the Terminal?

4 Answers 4

48

The syntax to open any file in its default application is

xdg-open <file_name>

If you want to have some fun and play the video in the terminal itself, install mplayer (sudo apt-get install mplayer) and run

mplayer -vo caca <movie_file>

It doesn't run directly in the terminal window, but it does display in ASCII characters.

2
  • xdg-open name.mov worked for me in Ubuntu 14.04 from Terminal connected using SSH. The other one showed things very weirdly. Thanks
    – Mona Jalal
    Jan 25, 2017 at 7:39
  • @MonaJalal haha the second one was just a fun command that tries to display the movie as ascii characters within the terminal. Feb 17, 2017 at 23:29
9

In general you start any command from a terminal by entering the command.

So to edit a file with gedit

gedit file_to_edit

An .avi is no different, just a different command

banshee your.avi

You may use any media player you wish.

the only thing is an avi itself is a container, so you may need to install some codecs. codecs are the tools to play mp3 and other audio visual files.

this link may help

LinuxCommand

1
  • 3
    general syntax is <program> <file to be played> Dec 11, 2011 at 5:01
2

totem can be anoter option. On my fresh installed Xenial it's the app that opens movie files from nautilus. It's available from Precise.

1
  • 1
    In addition to this, totem is the default video player for Gnome, and if you want to play video that requires authentication, like for example a password-protected video, typing totem 'url', will launch the player and ask you for a username/password
    – smac89
    Jan 19, 2017 at 21:09
0

Even arguments can be used, in terminal:

videoplayer-name videoplayer-arguments path-to-file

Path to file can be easily entered by dragging and dropping the file onto the terminal window.

Example, to only listen to the music of a video concert:

mpv --no-video file-dropped-onto-terminal-window

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .