Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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.