Linux How-to Find/Search for File/Directory/Image/Path on Command Line Terminal

May 27th, 2012 by Regaz

Linux locate Command Quick-Start

This short Guide will Get You Started with a Very Useful Command Line Utility: the locate Command.

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

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

This Exact Procedure Works on Most Linux Distros, 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

Linux Distros Crazy Penguin
  1. Open a Terminal Window
    (Press “Enter” to Execute Commands)
  2. Check if the updatedb Commad is On your System Path
    which updatedb

    If is Not there you Should Find another More Specific Guide or Consult your Specific Distro Documentation.

  3. Update the Locate Database:
    sudo updatedb

    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 Significant Change.

  4. Simple Keyword Searching
    locate keyword

    Whith this Syntax above you can Locate 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

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