Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools Console Foundations Environment and Redirection Find and Grep

Ian Mackenzie
Ian Mackenzie
11,062 Points

Finding an executable file within a directory on Mac

I'm trying to local the full path of the executable within a directory, the sublime text 3 directory to be more precise. What commands should I use on Mac's Terminal to local this?

3 Answers

Philip Cox
Philip Cox
14,818 Points

Hello Ian. I would enter the Terminal, change directory 'cd' to Applications, run list command 'ls'. This will show you all your applications. Is you see Sublime 3, cd into the folder, list command with option a will show all files in the Sublime directory ls -a including hidden ones, ls -la will show all files in the long version. -rwx- will be present. If the file has the x of read, write, execute then it's executable.

Hope this helps.

Ian Mackenzie
Ian Mackenzie
11,062 Points

Thanks for your reply Phillip,

After the ls command it shows the directory as Sublime Text.app and it won't let me cd into that folder. Is this a normal folder or a special type of folder due to the .app extension?

Philip Cox
Philip Cox
14,818 Points

That will most likely be the exe. You can also go into finder and search in Applications for the app. Right click and show contents, this may be an easier way to locate your file. This may also help you navigate in the Terminal once you know your path.