On Sat 16 May 2026 at 16:25:41 (-0400), Karen Lewellen wrote:
> 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.

I use a bash function for this task. I've attached it as some of the
lines are a bit long. I have it in my ~/.bashrc, making it always
available.

You can try it out by saving the attachment, and then typing:

  $ bash -c '. ./find-between; find-between today yesterday ./ | less'

which will give you a list of recent files in this directory,
piped into less as there may be many files in the list.

The function is documented, as can be seen by typing:

  $ bash -c '. ./find-between; find-between'
  Usage:  find-between timedate timedate top-of-trees …
          finds files under top-of-trees with modification timestamps between
          the two timedates given (free format, in any order; hint: '2000-12-31 
11:59'
          is a simple format that works). The output is sorted by filename.
  $ 

If you add the find-between file to your .bashrc, then you only have
to type the function name:

  $ find-between

  $ find-between today yesterday ./ | less

Obviously you would replace today and yesterday with real dates/times.
Their format is whatever is acceptable to   date --d   (see man date).
The order doesn't matter.

All files are listed, but it's a simple matter to grep the outout:

  $ find-between today yesterday ./ | grep 'txt$' | less

though you lose the header line as it's unlikely to match:

  From 2026-05-15 21:57:42-05:00 to 2026-05-16 21:57:42-05:00
  20260516-081119.08       2136  .Xresources
  [ … lots more filenames … ]

[Aside: replace the echo commands if they offend you.
 I have msgerr and msgout functions in their place.]

Cheers,
David.
function find-between {
    [ -z "$3" ] && echo "Usage: ${FUNCNAME[0]} timedate timedate top-of-trees …
        finds files under top-of-trees with modification timestamps between
        the two timedates given (free format, in any order; hint: '2000-12-31 
11:59'
        is a simple format that works). The output is sorted by filename." && 
return 1
    local Timea="$(date --rfc-3339=seconds --date "$1")"
    [ -z "$Timea" ] && return 2
    local Timeb="$(date --rfc-3339=seconds --date "$2")"
    [ -z "$Timeb" ] && return 2
    shift 2
    [ "$Timea" = "$Timeb" ] && msgerr "Times are the same (one minute 
resolution)" && return 1
    [ "$Timea" \> "$Timeb" ] && local Swap="$Timea" && Timea="$Timeb" && 
Timeb="$Swap" # A less then B
    echo "From $Timea to $Timeb"
    find "$@" -newermt "$Timea" -a -not -newermt "$Timeb" -type f -printf 
'%TY%Tm%Td-%TH%TM%.5TS%11s  %P\n' | sort -k 3
}

Reply via email to