<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/zsh-list-recently-modified-files-with-m0-glob-qualifiers-pucitqywh" -->

---
title: Zsh: list recently modified files with (m0) glob qualifiers
description: Zsh glob qualifiers can filter files by modification time using the `m` qualifier. `*(m0)` matches files modified within the past 24 hours, while `*(mh0)`...
canonical: https://daily.dev/posts/zsh-list-recently-modified-files-with-m0-glob-qualifiers-pucitqywh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Zsh: list recently modified files with (m0) glob qualifiers | daily.dev
og:description: Zsh glob qualifiers can filter files by modification time using the `m` qualifier. `*(m0)` matches files modified within the past 24 hours, while `*(mh0)`...
og:url: https://daily.dev/posts/zsh-list-recently-modified-files-with-m0-glob-qualifiers-pucitqywh
og:image: https://api.daily.dev/og/posts/pUCITQyWH.png
og:image:alt: Zsh: list recently modified files with (m0) glob qualifiers
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Zsh: list recently modified files with (m0) glob qualifiers

**[Adam Johnson](https://daily.dev/sources/adamj)** · 2 min read · 3 upvotes · 0 comments

## Summary

Zsh glob qualifiers can filter files by modification time using the `m` qualifier. `*(m0)` matches files modified within the past 24 hours, while `*(mh0)` narrows it to the last hour. Other time units include months (M), weeks (w), minutes (m), and seconds (s). Additional qualifiers like `**/*` for recursive search, `.` to exclude directories, and `N` to suppress errors when no matches exist make this a flexible tool for working with recently downloaded or modified files.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://adamj.eu/tech/2026/08/04/zsh-m0-glob-qualifiers>

## Questions this post answers

### How do I list only files modified in the last 24 hours using Zsh globbing?

Use the (m0) glob qualifier, which matches files modified zero whole days ago, meaning within the past 24 hours. For example, ls -ld *(m0) lists only recently touched files. To narrow the window to the last hour instead, add the h unit specifier as (mh0), since m alone counts in whole days by default.

_Developers automating downloads cleanup can find more shell tricks like this through daily.dev._

### How can I make a Zsh glob pattern expand to nothing instead of throwing an error when there are no matches?

Add the N glob qualifier to the pattern, for example ls -ld *(.m0N). Without N, a glob with no matches causes Zsh to error out; with N, it silently expands to nothing, which is especially useful inside scripts that need to handle empty results gracefully.

_Scripting reliably in zsh gets easier when developers share edge-case fixes like this on daily.dev._

## Similar posts on daily.dev

- [Zsh: select generated files with \(om\[1\]\) glob qualifiers](https://daily.dev/posts/zsh-select-generated-files-with-om-1-glob-qualifiers-fbfmj2ts0) · Adam Johnson · 0 upvotes · 0 comments
- [Zsh: find the largest files with the \(OL\) glob qualifier](https://daily.dev/posts/zsh-find-the-largest-files-with-the-ol-glob-qualifier-9cv5xzn5k) · Adam Johnson · 5 upvotes · 0 comments
- [Zsh: tab complete glob qualifiers](https://daily.dev/posts/zsh-tab-complete-glob-qualifiers-trzdr8umc) · Adam Johnson · 1 upvotes · 0 comments
- [FreHu/vscode-fresh-file-explorer: A vscode file explorer which shows only recently modified files based on a combination of Git history and your pending changes](https://daily.dev/posts/frehu-vscode-fresh-file-explorer-a-vscode-file-explorer-which-shows-only-recently-modified-files-ba-pqedwhbrb) · Hacker News · 3 upvotes · 0 comments

---

Tags: [#cli](https://daily.dev/tags/cli), [#shell](https://daily.dev/tags/shell), [#bash](https://daily.dev/tags/bash)

[View this post on daily.dev](https://daily.dev/posts/zsh-list-recently-modified-files-with-m0-glob-qualifiers-pucitqywh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Zsh: list recently modified files with (m0) glob qualifiers","url":"https://daily.dev/posts/zsh-list-recently-modified-files-with-m0-glob-qualifiers-pucitqywh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/zsh-list-recently-modified-files-with-m0-glob-qualifiers-pucitqywh"},"datePublished":"2026-08-04T22:03:33.185Z","dateModified":"2026-09-14T06:17:01.827Z","description":"Zsh glob qualifiers can filter files by modification time using the `m` qualifier. `*(m0)` matches files modified within the past 24 hours, while `*(mh0)`...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c64d7b40510f61c6d1cba7f667bd1173?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c64d7b40510f61c6d1cba7f667bd1173?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Adam Johnson","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Adam Johnson","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/bf70f4401c284aa5b628d1966029342c","url":"https://daily.dev/sources/adamj"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/zsh-list-recently-modified-files-with-m0-glob-qualifiers-pucitqywh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cli,shell,bash","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Adam Johnson","item":"https://daily.dev/sources/adamj"},{"@type":"ListItem","position":3,"name":"Zsh: list recently modified files with (m0) glob qualifiers"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/zsh-list-recently-modified-files-with-m0-glob-qualifiers-pucitqywh#faq","mainEntity":[{"@type":"Question","name":"How do I list only files modified in the last 24 hours using Zsh globbing?","acceptedAnswer":{"@type":"Answer","text":"Use the (m0) glob qualifier, which matches files modified zero whole days ago, meaning within the past 24 hours. For example, ls -ld *(m0) lists only recently touched files. To narrow the window to the last hour instead, add the h unit specifier as (mh0), since m alone counts in whole days by default. Developers automating downloads cleanup can find more shell tricks like this through daily.dev."}},{"@type":"Question","name":"How can I make a Zsh glob pattern expand to nothing instead of throwing an error when there are no matches?","acceptedAnswer":{"@type":"Answer","text":"Add the N glob qualifier to the pattern, for example ls -ld *(.m0N). Without N, a glob with no matches causes Zsh to error out; with N, it silently expands to nothing, which is especially useful inside scripts that need to handle empty results gracefully. Scripting reliably in zsh gets easier when developers share edge-case fixes like this on daily.dev."}}]}
```

