Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

ZSH Permission Denied When Executing Sublime Text

My user should have ownership to Sublime.

myusername@Andreass-Mini ~ % ls -l /Applications/Sublime\ Text.app
total 0
drwx------  8 myusername  admin  256 Jun 26  2021 Contents
myusername@Andreass-Mini ~ % 

But I cannot execute it:

myusername@Andreass-Mini ~ % /Applications/Sublime\ Text.app 
zsh: permission denied: /Applications/Sublime Text.app

But I can open it:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

myusername@Andreass-Mini ~ % open /Applications/Sublime\ Text.app

I used 755 and even 777

sudo chmod 755 /Applications/Sublime\ Text.app

And made sure that it’s owned by the current user

myusername@Andreass-Mini ~ % sudo chown -R $(whoami) /Applications/Sublime\ Text.app 

The Terminal has full disk access. The file is not locked. But I cannot execute it.

I have several scripts where I need to be able to execute it and open files with it. Can you point me what I missed in order to have the permission to execute it.

>Solution :

/Applications/Sublime\ Text.app is the name of a folder, not an executable file. To run the program from the command line, you need to launch the executable, like this:

/Applications/Sublime\ Text.app/Contents/MacOS/sublime_text

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading