You can open the a file from the macOS CLI with the command open
.
- To open a file with the default app, use:
open $FILENAME
- To open the current directory, use:
open .
- To open a specific directory, use
open $DIRECTORY_NAME
- To open a URL, use:
open $URL
Thanks to this post for teaching me this.