open
filemacOS/Linux
The open command is one of the most frequently used commands in Linux/Unix-like operating systems. open Open files, directories, or URLs with default applications
Quick Reference
Command Name:
open
Category:
file
Platform:
macOS/Linux
Basic Usage:
open [options] [arguments]
Common Use Cases
Syntax
open [options] file/URL...
Options
Option | Description |
---|---|
-a application |
Open file with the specified application |
-e |
Open with TextEdit (macOS) or default text editor |
-t |
Open with default text editor |
-f |
Read input from standard input and open with TextEdit/default editor |
-F |
Open application without restoring windows |
-b bundle_identifier |
Open file with application specified by bundle identifier |
-n |
Open a new instance of the application even if one is already running |
-g |
Do not bring the application to the foreground |
-h |
Show help information |
-R |
Reveal file in Finder/file manager instead of opening |
--args |
Pass all remaining arguments to the opened application |
Examples
How to Use These Examples
The examples below show common ways to use the open
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
open document.pdf