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


Groups > linux.debian.user > #286691

Re: a hopefully simple ls command question?

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: a hopefully simple ls command question?
Date 2026-05-16 14:50 +0200
Message-ID <MVmCS-5z7Q-9@gated-at.bofh.it> (permalink)
References <MVelX-5t8F-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

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