Hi Greg,
Thanks, I am aiming for solidity here.
I am using a screen reader.
The text editor wording is a bit confusing.
Also, because I create many text files in a given day, my goal is very
tight here, but it seems I cannot provide actual dates, just a number of
days
window?
There is not a syntax for say the window of 12 may, say 5 days ago until
14 may, which would be 2 days ago?
if I follow using . provides my home directory, where my files are
stored, is that correct? This is not my desktop, but a service.
I do understand that I should write say "*.txt"
However I need to be sure I have corrected the mistake you noted, should
it be namef with the dash character?
Your extras with print seem profoundly complex.
My goal is clear text, that my screen reader can manage, when I use its
own review mode.
Does that make more sense?
My goals are very tight, as I want to locate a file I saved within this
small window, with screen output that my talking computer manages.
Thanks,
Kare
On Sat, 16 May 2026, Greg Wooledge wrote:
On Sat, May 16, 2026 at 14:55:54 -0400, Karen Lewellen wrote:
So, if I want to find items ending in .txt from a certain date window, what
am I missing?
As you're adding complexity, I would move away from the "ls + text editor"
approach and toward find.
I understand the start syntax of the following, still unsure if find needs
to be run in quotation marks however, so
find - name *.txt -print
would print the files ending in .txt to the screen.
where would the date be added, and where does that land in the syntax?
OK, to answer your questions:
1) In this command, the * character needs to be quoted. Usually, people
will quote the entire word *.txt instead of just the *, but there
are many different valid ways to write it. '*.txt' or "*.txt" are
the most common.
2) If you want to add date information to the output, the simplest way
would be to use the -ls action instead of the -print action.
Now, two minor corrections:
1) You wrote "- name" but this should be "-name".
2) find is supposed to be given a starting directory. GNU find lets
you omit this argument, and assumes "." as the starting directory.
However, I still prefer using the correct syntax.
Putting it all together: to list all the files ending with .txt including
modification times, you can use:
find . -name '*.txt' -ls
If you want more control over the output, you can replace -ls with a
more complex action, such as -printf FORMAT:
find . -name '*.txt' -printf '%t %p\n'
That shows the modification time in a human-readable format, and the
full relative path, for each file whose name ends with .txt.
If you want to include date restrictions, you can add those as well:
find . -name '*.txt' -mtime +5 -mtime -11 -printf '%t %p\n'
That one would show files whose names end with .txt, and whose
modification time is more than 5 days ago, and whose modification time
is less than 11 days ago.
This is just a starting point. find can do a *lot*.