Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command to open Sublime from OSX terminal

Is there a way to open files using Sublime from OSX terminal:

Like this in Linux, but the equivalent in OSX:

gedit file.txt
like image 790
Amr M. AbdulRahman Avatar asked Dec 24 '22 03:12

Amr M. AbdulRahman


2 Answers

You can also create a symbolic link to Sublime Text to launch it from the terminal with a simple command like "sublime path":

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime

You should change the installation path accordingly. It's also possible to use any other alias than sublime, but it's best to be explicit.

like image 109
Zeynep Akkalyoncu Avatar answered Jan 15 '23 06:01

Zeynep Akkalyoncu


You can use the general command for opening files with an application, like:

open -a Sublime.app file.txt
like image 20
Renzo Avatar answered Jan 15 '23 06:01

Renzo