Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #286702

Re: a hopefully simple ls command question?

Path csiph.com!weretis.net!feeder8.news.weretis.net!srl.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod
From Karen Lewellen <klewellen@shellworld.net>
Newsgroups linux.debian.user
Subject Re: a hopefully simple ls command question?
Date Sat, 16 May 2026 22:30:02 +0200
Message-ID <MVtO2-5E2T-11@gated-at.bofh.it> (permalink)
References <MVelX-5t8F-1@gated-at.bofh.it> <MVmCS-5z7Q-9@gated-at.bofh.it> <MVsoV-5CXY-5@gated-at.bofh.it> <MVsRX-5Dqo-1@gated-at.bofh.it>
X-Original-To Greg Wooledge <greg@wooledge.org>
X-Mailbox-Line From debian-user-request@lists.debian.org Sat May 16 20:26:08 2026
Old-Return-Path <klewellen@shellworld.net>
X-Amavis-Spam-Status No, score=-7 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5] autolearn=ham autolearn_force=no
X-Policyd-Weight using cached result; rate: -3.5
MIME-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Mailing-List <debian-user@lists.debian.org> archive/latest/830257
List-ID <debian-user.lists.debian.org>
List-URL <https://lists.debian.org/debian-user/>
List-Archive https://lists.debian.org/msgid-search/Pine.LNX.4.64.2605161612110.3281346@users.shellworld.net
Approved robomod@news.nic.it
Lines 83
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Cc debian-user@lists.debian.org
X-Original-Date Sat, 16 May 2026 16:25:41 -0400 (EDT)
X-Original-Message-ID <Pine.LNX.4.64.2605161612110.3281346@users.shellworld.net>
X-Original-References <Pine.LNX.4.64.2605152343230.3253366@users.shellworld.net> <20260516124323.GA21841@wooledge.org> <Pine.LNX.4.64.2605161450390.3280674@users.shellworld.net> <20260516192029.GC31523@wooledge.org>
Xref csiph.com linux.debian.user:286702

Show key headers only | View raw


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*.
>
>

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-16 06:00 +0200
  Re: a hopefully simple ls command question? David Christensen <dpchrist@holgerdanske.com> - 2026-05-16 06:30 +0200
    Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-16 09:20 +0200
      Re: a hopefully simple ls command question? debian-user@howorth.org.uk - 2026-05-16 12:20 +0200
      Re: a hopefully simple ls command question? David Christensen <dpchrist@holgerdanske.com> - 2026-05-17 08:00 +0200
        Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-17 23:20 +0200
  Re: a hopefully simple ls command question? Teemu Likonen <tlikonen@iki.fi> - 2026-05-16 07:00 +0200
    Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-16 09:20 +0200
      Re: a hopefully simple ls command question? Dan Ritter <dsr@randomstring.org> - 2026-05-16 10:20 +0200
  Re: a hopefully simple ls command question? Greg Wooledge <greg@wooledge.org> - 2026-05-16 14:50 +0200
    Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-16 22:30 +0200
      Re: a hopefully simple ls command question? Greg Wooledge <greg@wooledge.org> - 2026-05-16 22:50 +0200
        Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-16 23:10 +0200
          Re: a hopefully simple ls command question? debian-user@howorth.org.uk - 2026-05-17 18:40 +0200
      Re: a hopefully simple ls command question? Dan Ritter <dsr@randomstring.org> - 2026-05-17 01:00 +0200
        Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-17 02:30 +0200
      Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-17 07:30 +0200
        Re: a hopefully simple ls command question? John Hasler <john@sugarbit.com> - 2026-05-17 15:20 +0200
        Re: a hopefully simple ls command question? John Hasler <john@sugarbit.com> - 2026-05-17 22:10 +0200
          Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-18 00:10 +0200
        Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-18 05:50 +0200
          Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-18 07:00 +0200
            Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-18 07:40 +0200
      Re: a hopefully simple ls command question? David Wright <deblis@lionunicorn.co.uk> - 2026-05-18 05:30 +0200
    Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-16 22:40 +0200
      Re: a hopefully simple ls command question? Chime Hart <chime@hubert-humphrey.com> - 2026-05-16 22:50 +0200
        Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-16 23:10 +0200
          Re: a hopefully simple ls command question? CGS <etphonehomefrance@gmail.com> - 2026-05-17 16:40 +0200
    Re: a hopefully simple ls command question? Karen Lewellen <klewellen@shellworld.net> - 2026-05-16 21:00 +0200
      Re: a hopefully simple ls command question? Karl Vogel <vogelke+debian@pobox.com> - 2026-05-16 21:50 +0200
      Re: a hopefully simple ls command question? Greg Wooledge <greg@wooledge.org> - 2026-05-16 21:30 +0200
        Re: a hopefully simple ls command question? Andrew Latham <lathama@gmail.com> - 2026-05-16 21:30 +0200

csiph-web