• Home
  • Python
    • Introduction to Python
    • Python Developer
  • JavaScript
    • Introduction to JavaScript
    • JavaScript Developer
  • React.js
    • Introduction to React
    • React Developer
  • TypeScript
    • Introduction to TypeScript
    • TypeScript Developer
  • Linux Shell
    • Introduction to the Linux Shell
    • Linux Shell Developer
  • C++
    • Introduction to C++
    • C++ Developer
  • C Language
    • Introduction to C
    • C Developer
  • Rust
    • Introduction to Rust
    • Rust Developer
  • Zig
    • Introduction to Zig
    • Zig Developer
  • Interactive Training
  • Pricing
  • Brainstorm
STEMTrainingGrounds
  • Courses
    • Home
    • Python
      • Introduction to Python
      • Python Developer
    • JavaScript
      • Introduction to JavaScript
      • JavaScript Developer
    • React
      • Introduction to React
      • React Developer
    • TypeScript
      • Introduction to TypeScript
      • TypeScript Developer
    • Linux Shell
      • Introduction to the Linux Shell
      • Linux Shell Developer
    • C++
      • Introduction to C++
      • C++ Developer
    • C Language
      • Introduction to C
      • C Developer
    • Rust
      • Introduction to Rust
      • Rust Developer
    • Zig
      • Introduction to Zig
      • Zig Developer
  • Interactive Training
  • Pricing
  • Navigate
    • Home
    • Reading Grounds
    • Brainstorm

Quick Links

  • About Us
  • Pricing
  • Partnership
  • Brainstorm
  • Terms
  • Privacy
  • Refunds

Courses

  • Python
    • Introduction to Python
    • Python Developer
  • JavaScript
    • Introduction to JavaScript
    • JavaScript Developer
  • React
    • Introduction to React
    • React Developer
  • TypeScript
    • Introduction to TypeScript
    • TypeScript Developer
  • Linux Shell
    • Introduction to the Linux Shell
    • Linux Shell Developer
  • C++
    • Introduction to C++
    • C++ Developer
  • C Language
    • Introduction to C
    • C Developer
  • Rust
    • Introduction to Rust
    • Rust Developer

Newsletter

Subscribe to our free monthly newsletter, for a quick update on Python, JavaScript, and React news

© 2025 - 2026 STEMTrainingGrounds. All Rights Reserved.

Linux Shell Developer -

Lesson 1 of 35

Lesson Progress: 0%

Lesson Progress: 0%
Lesson Incomplete
Lesson 1 of 35
Next: Linux find command →

The locate command finds files anywhere on the filesystem by their name. You give it a name or pattern, and it searches the whole system to find matching files. Unlike find, which searches live,locate is designed to be fast and simple — it just matches names. Use locate when you know the name of a file but not where it is stored.

  • locate poem.txt finds any file named poem.txtanywhere on the system.
  • The output shows the full path to each matching file.
  • If there is only one file with that name, a single path is returned.
  • The locate command is a quick way to find files without navigating through directories.
  • locate *.txt finds every file ending in .txt.
  • The * wildcard matches any characters, so *.txtmatches all text files.
  • Multiple files may be found across different directories.
  • Using wildcards with locate is the fastest way to find all files of a certain type.
  • locate notes* finds all files whose name starts withnotes.
  • The wildcard can be at the end of the pattern to match a prefix.
  • This is useful when you remember the start of a filename but not the full name.
  • locate searches the entire filesystem, so you do not need to know which directory the file is in.
  • locate data* finds files starting with data.
  • In this example, the file is inside a subdirectory, butlocate still finds it.
  • The full path /home/user/Documents/data.txt shows exactly where the file lives.
  • This makes locate perfect for when a file is buried deep in folders.
  • locate info* finds all files starting with info.
  • When multiple files match the pattern, all their paths are shown.
  • In this example, both info.txt andinfo_backup.txt are found.
  • The locate command finds every match, no matter how many there are.
  • locate script.sh finds a shell script by its exact name.
  • Unlike *.txt, searching for an exact name returns only files with that specific name.
  • If no file matches the pattern, locate shows an error message.
  • The locate command works well alongside other commands like file and stat for inspecting found files.
Task Incomplete
Example
~$ locate poem.txt
  • Run locate poem.txt
Linux Shell
~$
Task Incomplete
Example
~$ locate *.txt
  • Run locate *.txt
Linux Shell
~$
Task Incomplete
Example
~$ locate notes*
  • Run locate notes*
Linux Shell
~$
Task Incomplete
Example
~$ locate data*
  • Run locate data*
Linux Shell
~$
Task Incomplete
Example
~$ locate info*
  • Run locate info*
Linux Shell
~$
Task Incomplete
Example
~$ locate script.sh
  • Run locate script.sh
Linux Shell
~$