How to Find Documents & Applications on Your Mac Using Terminal

| TMO Quick Tip

Terminal Find Unix Command

On Mac Geek Gab Episode 413, John and Dave discussed several ways to determine which applications on your Mac were based on Java, Oracle’s multi-platform programming language.

Many methods were discussed during the show, but the simplest one was suggested afterwards by Peter Lewis of Stairways Software, maker of the excellent Keyboard Maestro utility.

To locate Java applications, open Terminal and type the following command:

find /Applications -name “*.jar”

Using the find command, this query will search the system’s Application folder for files that have “.jar” in their name, which identifies them as Java applications, and display a list of all files that meet the search criteria. This command can be modified to find almost anything at any location on your Mac’s drive, such as:

  • Search the entire drive for Java applications and not just the Applications folder: find / -name “*.jar”
  • Search the User’s Documents folder for PDF files: find ~/Documents -name “*.pdf”
  • Search the User’s Downloads folder for Windows executables find ~/Downloads -name “*.exe”
  • Search for a specific file on the Mac: find / -name “filename.txt”

For more information on using the find command, open Terminal and type:

man find

This will launch the manual for the find command and allow you to browse the hundreds of different parameters and options for using it. There are also many websites with tutorials for find and other Unix commands.

Teaser graphic made with help from Shutterstock.

Sign Up for the Newsletter

Join the TMO Express Daily Newsletter to get the latest Mac headlines in your e-mail every weekday.

Comments

droid

If you want to search the entire disk you may need to be the root user or use sudo. This will allow you to read directories that your user doesn’t have permission to see into, such as another users ~/Applications folder.
It also reduces the number of ‘permission denied’ errors in the output.

e.g. in an admin user account?
sudo find / -name *.app

Also the ‘-x’ option can also be helpful since it prevents a search of the root disk descending into /Volumes/(all the other mounted disks).

mdfind is also helpful if you want to read the Spotlight index (find content, not filenames etc).

Log-in to comment