How can I list the 10 most recently modified files of a certain extension, not all files, or the files modified during the last 2 days for example?
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
You can use find for this. Let's say we want all .py files in the current directory modified in the last 2 days:
|
|||
|
|
|
With zsh
for the last two days:
Otherwise, if filenames don't contain newline characters, you can always do:
And for files modified in the last two days POSIXly:
|
||||
