Simd
Simd

Reputation: 21333

How to find the most recently edited files

How can I find the most recently modified *.ipynb files in the subtree starting from the current directory? Ideally I would like a sorted list with the most recently modified ones shown first.

I am using Ubuntu 22.04 and am happy to use GNU tools.

Upvotes: 1

Views: 194

Answers (2)

Gilles Quénot
Gilles Quénot

Reputation: 185528

Like this with :

(shopt -s globstar; ls -lt **/*.ipynb)

Upvotes: 2

Rachel
Rachel

Reputation: 11

You can use find with -newermt option as below.

The below command finds the files modified in the last 24 hours.

find . -type f -newermt "-24 hours" 

Similarly,

find . -type f -newermt "-10 minutes" 
find . -type f -newermt "1 day ago" 
find . -type f -newermt "yesterday"

Upvotes: 0

Related Questions