Open file with application by terminal in MacOS

Опубликовано: 30 Июнь 2026
на канале: Equaltrue
122
3

Open file with application in MacOS Terminal
Common type of file like
php.ini file
.conf file
.htaccess file
read only file

Common application like
Visual Studio Code
PhpStorm
Sublime
TextEdit

Format :
open flag_value application_name file_name
here : application_name will need if you only use -a flag

Example :
Suppose want to open Visual Studio Code
open -a "Visual Studio Code" http.conf
or Text Edit
open -a TextEdit http.conf

Flag :
-a : Open with custom application
-t : open with default editor
-e : open specifically with TextEdit

The theme use in Terminal are :
https://github.com/romkatv/powerlevel10k