66

I want to open videos and pictures from Terminal. Is there any way to do this?

  • What is this? questions should be stand alone and not depend on other sites – Mark Oct 24 '15 at 21:48
  • this question is dependent on stackexchange website. If thats not allowed I can recopy complete stuff from that site to this site. – Abhimanyu Aryan Oct 24 '15 at 21:59
  • 1
    I edited the question so it stands on its own. It didn't require external information. – Timothy Mueller-Harder Oct 24 '15 at 22:01
  • Please and explain what you want to do in user terms not just the ebonite command - and note the edit to improve the text has lost the link so you need to edit – Mark Oct 24 '15 at 22:02
94

To open any file from the command line with the default application, just type open followed by the filename/path.

Example:

open ~/Desktop/filename.mp4

Edit: as per Johnny Drama's comment below, if you want to be able to open files in a certain application, put -a followed by the application's name in quotes between open and the file.

Example:

open -a "QuickTime Player" ~/Desktop/filename.mp4

If you need further information about the open command, type man open.

  • 7
    Just to complete this answer: With timotyhm's command you will open the file with the default application for this filetype. If you want to open any file with a specific application, just enter: open -a "Application" /Path/to/file. Example: open -a "Adobe Photoshop CC 2014" ~/Desktop/test.psd. See man open for more information. – joni Oct 25 '15 at 8:05
  • @JohnnyDrama Good point. Can I edit that into my answer? – Timothy Mueller-Harder Oct 25 '15 at 15:39
  • 2
    The collaboration in answers is awesome. Johnny Drama's answer is what I really wanted, but the title is what I searched. Answers like these are why I love StackExchange! – mbm29414 Sep 30 '16 at 13:16
  • This does not work. 18.04. jpg. – mathtick Dec 2 '18 at 14:50
-1

It can also be done by using xdg-open filename. Command will open the file with it's default application and it also used to open the urls .

  • xdc-open is not a stock Mac OS X tool. – lhf Jan 2 '18 at 17:49
  • xdg-open is on Linux and macOS is not Linux! The accepted answer has the default macOS command line app, open. – user3439894 Jan 2 '18 at 17:58
-1

"open ." to open current directory.

  • 2
    Hi, while this does work (it opens the current folder in the Finder), this does not seem to answer the question (which is to open videos and pictures from the terminal, not the folder they reside in). Can you add any more detail to your answer which will help answer the question? – Skeleton Bow Jul 5 '18 at 4:15

You must log in to answer this question.

protected by Mark Jul 15 '18 at 19:04

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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