Mac OS X Mavericks 10.9 How-to Find/Search for File/Directory/Image/Path on Command Line Terminal

November 26th, 2014 by Zen BSD

Mac OS X locate Command Quick-Start



This short Unix Tutorial Get you Started on Mac OS X Mavericks 10.9 with a Very Useful Shell Utility: the locate Command.

Everybody when Working on Linux, Mac or Unix need so Often to Find some Files, Directories, Images or Paths.

One of the Best and Fastest Ways to Find System’s Entities in Unix-like Platforms is Matched Using the “locate” Shell Command.

This Exact Procedure Works on all Mac OS X Versions, but some times the updatedb Command is Not Under the Same Nomination or Path like Here, so if you Do Not Find the updatedb on your System Look For a more Specific Tutorial.

Take the Time of Reading and Understanding to Get a Clear Insight

Mac OS X locating file/directory/image/path quick-start - featured
  1. Open a Command Line Terminal Window
    Applications > Utilities > Terminal
    (Press “Enter” to Execute Commands)

    How-to Find/Search for File/Image/Path/Directory on Mac OS X Command Line - Open Terminal
  2. Make a Command Alias to Update the locate Database

    nano $HOME/.profile

    Append:

    alias updatedb="sudo /usr/libexec/locate.updatedb"
  3. Update the Locate Database:

    updatedb

    You’ll be Propted to Insert the root User Password
    You need to Wait for a little while Until the Locate Database is Updated…
    This procedure Should be Repeated Every Time you Use the locate Command and your System made some Signifitive Change.

  4. Simple Keyword Searching

    locate KEYWORD

    Whith this Syntax above you can simply Locating All Files, Directories, Images and Paths Containing the Given “KEYWORD”

  5. How-to Automatically Update the locate Database

    Setup Cronjob for updatedb
  6. How-to Refine your locate Search-Results

    How-to Use grep with locate
Share on Tumblr

Tags: , , , , , , , , , , , , ,


Comments are disabled