Search/Find File/Folder/Directory on Gnu/Linux Command Line

May 30, 2021 | By the+gnu+linux+evangelist.

Locating on Command Line

  1. 2. Checking Up

    Check if the updatedb Commad is on System’s Path
    With:

    which updatedb

    If is Not there you Should Find another More Specific Guide or Consult your Specific Distro Documentation.
    But if Missing it may be Installed as: mlocate.
    To Setup it Ubuntu/Debian based use:

    sudo apt install mlocate

    And on CentOS/Fedora:

    sudo yum install mlocate
  2. 3. Updating locate DB

    Then to Update the Locate Database
    Play:

    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.

  3. 4. Searching on Command Line

    for a Simple Keyword Searching
    Try:

    locate [keyword]

    As for Instance, to Locate a Printer Ppd File:

    locate .ppd

    Whith this Syntax above you can Locate All Files, Directories, Images and Paths Containing the Given “keyword”.

    How to Automatically Update the locate Database

    Setup Cronjob for updatedb
  4. 5. Refining Search with grep

    How to Refine your locate Search-Results

    How to Use grep with locate

Contents


QuickChic Theme • Powered by WordPress