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 a file with a specific applicationAdding the flag
-ato 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.
Open the folder which contains the fileIf you want to open the folder that contains a specific file, just use the flag
-Rand 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.
Open a file with an editorIf you want to open a file with your default editor, just use the flag
-tand write the path and the name of the file you want to open.
open -t Desktop/text.txt
Visit a WebsiteYou can use this tool not only to open files and folders, but also webpages. Just write the command
openfollowed 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).