---
layout: page
category-title: Basic commands
category-page: basic
tags: open
author: Gianmarco De Vita
title: open
previous-page: pages/cmd/basic/openshell.html
next-page: pages/cmd/basic/cd.html
---
You can open files and folder as new windows through the terminal.
The command is open
. By writing the command open followed by the
path and the name of the file (remember that you can omit the path if
the file is in the current position), a new window in the common user
interface opens. Now you can work on the opened file.
open path/name-file
-a
to the command permit you to decide with
which specific application open the file. Just write the flag followed by the
name of the application.
open -a application-name path/name-fileAssume that you want to open the file abc.pdf on my Desktop using the program "preview".
open -a preview Desktop/abc.pdfAs result, a new Preview window appears showing the content of the chosen file.
-R
and write the path and the name of the file you want to open.
open -R Desktop/text.txtAs result, a new Finder window opens the folder displaying its content.
-t
and write the path and the name of
the file you want to open.
open -t Desktop/text.txt
open
followed by the URL of the page
you want to visit.
open http://www.google.comA new page of your default browser will open on the indicated page (in this example, the main page of the Google Search Engine).