TTYGod
Articles / Workflow

Track down a missing draft by its filename

A friend asks for the handout you prepared last month. You remember calling it a draft, and you have a folder full of workshops, but the contents of those folders stretch over several years. Search the names before opening every document.

TTYGod editorial desk · AI-assisted launch edition · Issue ·
Share WhatsAppLinkedInEmail
Notebook beside a terminal monitor
Notebook beside a terminal monitor · AI-generated editorial illustration
תקציר בעברית

מחפשים טיוטה אבודה לפי חלק משם הקובץ? השוו שאילתה ממוקדת לחיפוש רחב יותר ובדקו אילו טיוטות נכנסות לרשימה כשמשנים מילה אחת.

Build a tiny filing cabinet

In a new practice folder, use your file manager to create a workshop folder and an archive folder. In workshop, make a plain text file called Garden Draft.txt. In archive, make garden notes.txt. Put any short sentence in each. Open a terminal in the practice folder. Run pwd and check the final folder name. The dot in the command you are about to run means this directory and gives you control over how much ground to cover. Read the find manual.

Follow the match

Type find . -type f -iname '*draft*' -print and press Return. The result should include ./workshop/Garden Draft.txt. The f asks for files, which prevents a folder called Drafts from becoming a distracting result. The two stars stand for any sequence of characters before and after draft. Quoting the pattern passes both stars through to find. Without the quotes, the shell may try to interpret them against only the names in your current folder.

Notebook beside a terminal monitor
Notebook beside a terminal monitor · AI-generated editorial illustration

Change one thing at a time

Try '*garden*' as the pattern. Now both files should appear even though Garden starts with a capital letter in just one name. Next try '*draft*.txt' to focus on that extension. A blank result is information about the precise question you asked. A handout might end in .pdf, contain a different spelling or sit outside the starting directory. Broaden one condition and repeat the search so you know what made a difference.

Choose among real candidates

When you find several results, read the directory names first. Workshop materials and archived copies may have identical filenames, but the route to each is often a clue to its purpose. Inspect the selected file in your usual editor or viewer and confirm a phrase from the handout. Copy the complete path into your notes if you will need it again. The search only prints names, so all your candidates remain available for comparison. If you share a result, copy its relative path together with the name of the folder where you began. For further reading, browse command line for beginners books.

Before you begin

What changes when you search for garden instead of draft?

Check your result

Both sample filenames match garden. The first query finds only the workshop draft.

Reference · Read the find manual

Bookshop.org

For further reading, browse the bookshop catalogue and compare titles and editions.

This merchant link currently earns this publication no commission. Affiliate disclosure

Browse command line for beginners books

Reader notes

Read community notes

No reader notes yet.

Related articles

Mechanical keyboard and paper notes
Issue ·
Workflow

Find the note that mentions a blue envelope

You remember putting the pickup instructions in a text file. The date, the filename and the folder have slipped your mind. What stayed with you is the phrase “blue envelope.” That fragment is enough to make a small, repeatable search.

Laptop on a dark desk
Issue ·
Workflow

Turn a messy packing list into a useful tally

Three people send lists for a picnic and all three volunteer to bring cups. Before assigning anyone another job, put one item on each line and see which promises overlap. This exercise works entirely in a terminal and keeps the original list intact.

Portable drive beside a keyboard
Issue ·
Workflow

Measure a draft without counting its headings twice

You have a short reading to deliver and the organiser has given you a word limit. A terminal count can give you a quick baseline, provided you decide which parts of the draft belong in the count. A tiny sample makes the conventions visible.