Tuesday, December 11, 2012

Mac OS X - Terminal Tricks

Mac OS X - Terminal Tricks

Finding absolutely anything on your Macintosh

The Spotlight feature doesn't search the Library or hidden locations.

Aside from Spotlight feature, OSX also has a Find feature. Unlike Spotlight you can configure OSX's Find feature (CMD+F) look for system files by performing the following:

  1. Press CMD+F to open the Find window.
  2. Towards the left of the window, just above where the search results would appear, you'll a pull-down menu which says (by default)Kind. Click this, and choose Other.
  3. In the window that opens, scroll down, find, and check off System files.
  4. Click OK to close the window.
  5. Now, you can perform searches which will include System files in the results. To do this, select the following criteria for your search:
    System files include.

However, even this will not search all files on your Mac (i.e. items in hidden folders). To search all locations for a file, perform the following:

  1. Open Macintosh HD > Applications > Utilities > Terminal
  2. In the window that opens, type the following, then press Enter:

    sudo find / -name "*Bicycles*"

    ...where in-place of Bicycles you enter your search term.
  3. You will be presented with a list of file-paths to any items whose file name contains your search term. The search can take a long time to complete. When the command prompt is displayed again (the same one which initially appeared at the top of the Terminal window when you first opened it), you'll know the search has completed.

No comments: