World map

 

BM: Baca dalam Bahasa Melayu

World L1: The Shophouse

Find files with find

You will learn: to make the server search every room for a file by name or kind.

Checked with Linux (Debian 13) on 1 Nov 2026

The problem

Mak’s secret sambal recipe is lost in the store room. It sits in a box, inside a box. Do you open every room with cd and ls?

Pick one answer.

Watch

You are you in /home/you. 1 things here. Services: cron running, ssh running, nginx running.

You are hereyou@kedai:~$

Folder ~

  • kedai/ (folder)drwxrwxr-xcounter kitchen menu store

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

find walks through kedai and every room inside it. -name sambal.txt keeps only that name. It prints the path of each match.

Predict

Mak named her file Sambal-Mak.txt. Does find kedai -name "sambal*" find it?

Pick one answer.

Try it

Find every sambal recipe, big letters or small: find kedai -iname "sambal*".

You are you in /home/you. 1 things here. Services: cron running, ssh running, nginx running.

You are hereyou@kedai:~$

Folder ~

  • kedai/ (folder)drwxrwxr-xcounter kitchen menu store

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Check

find can test more than names. Which test fits each search?

Drag a card into a box. Or tap the card, then tap the box.

        Try it

        Find every log file in the shop: find kedai -name "*.log".

        You are you in /home/you. 1 things here. Services: cron running, ssh running, nginx running.

        You are hereyou@kedai:~$

        Folder ~

        • kedai/ (folder)drwxrwxr-xcounter kitchen menu store

        + 3 hidden (ls -a)

        Services

        • cronrunningstarts at boot
        • sshrunningstarts at boot
        • nginxrunningstarts at boot

        Check

        Build a search for empty folders, so you can tidy them later.

        Tap the pieces in the right order.

        …

        You did it!

        You can now find files by name, kind or emptiness.

        Go deeper (optional)

        Search from / and you see lines like find: ‘/root’: Permission denied. Plain words: rooms you have no key for. World L2 explains keys. -delete and -exec act on every match: run the search alone first.

        Real rep (optional): on Linux, find /etc -name "*.conf" lists settings files. Ignore the Permission denied lines.