Hi Greg,
I have no issues using find. I simply have never heard of the option until now, as my Linux access is only via shell services.
Granted I read your resource quickly, so  need to confirm syntax.
This is important, not all characters in your examples are spoken.
So, if I want to find items ending in .txt from a certain date window, what am I missing? 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?

Thanks,

Kare



On Sat, 16 May 2026, Greg Wooledge wrote:

On Fri, May 15, 2026 at 23:46:38 -0400, Karen Lewellen wrote:
Hi folks,
Will aim to ask this simply enough.
is there an option  for the ls command allowing you to set the date window
you are searching?
For example, list only the items    added  on a certain series of days?

Others have recommended find(1) and that's a valid solution.  It's very
powerful and worth learning.  I also have a wiki page for it:
<https://mywiki.wooledge.org/UsingFind>

If you really want to do it with ls(1) and not find(1), you'll need to
perform a multiple-step, manual process:

   ls -lt > /tmp/list
   Open /tmp/list in a text editor.
   Find the first file you want to keep, and delete every line above it.
   Find the last file you want to keep, and delete every line below it.
   Save and exit.

At this point, /tmp/list will contain an "ls -l" listing of all the
files you want, sorted by modification time.

If you want anything more complex than that, find(1) is the right tool
for the job.



Reply via email to