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


Groups > comp.unix.shell > #4516

Re: Find the oldest files without using ls -tr

From Ivan Shmakov <oneingray@gmail.com>
Newsgroups comp.unix.shell
Subject Re: Find the oldest files without using ls -tr
Date 2012-03-16 10:24 +0700
Organization Aioe.org NNTP Server
Message-ID <864ntp5itl.fsf@gray.siamics.net> (permalink)
References (4 earlier) <u73739-sk21.ln1@anubis.morrow.me.uk> <jjqo6sUn64L1@news.in-ulm.de> <20120314190115.GB6799@yahoo.fr> <86bony8r9a.fsf@gray.siamics.net> <20120315081330.GB4808@yahoo.fr>

Show all headers | View raw


>>>>> Stephane Chazelas <stephane_chazelas@yahoo.fr> writes:
>>>>> 2012-03-15 10:41:53 +0700, Ivan Shmakov:
>>>>> Stephane Chazelas <stephane_chazelas@yahoo.fr> writes:

[...]

 >>> ... obsoletes xargs in direct combination with find, not in
 >>> combination with other commands or with other usage patterns or
 >>> with things like find ... | grep ... | xargs ...

 >> Why one may want grep(1) instead of (GNU) find's own -name, -regex,
 >> etc.?

 > Why use less legible syntax when there's a tool expressly designed
 > for the task.

	Is -name x\* less legible than | grep '/x[^/]*$'?

[...]

 >> But still, there's no need to sort the stream as a whole just to
 >> find the N lowest elements.

 > Indeed, but again, would result in a lot more complex and illegible
 > code for something that is straightforward with sort and easy to
 > understand at first glance.

	The issue of the code readability is the consequence of using
	the tools not quite designed for the task.  And sort(1) is not
	designed to search for N rows having minimum (or maximum) keys.
	(ISTR that there was such a tool.)

	I've seen file archives with 300 000 files and more.  There,
	sorting doesn't seem like a proper choice, unless it's a
	throw-away code for a one-time task.

-- 
FSF associate member #7257

Back to comp.unix.shell | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Find the oldest files without using ls -tr Paul Branon <paulbranon@googlemail.com> - 2012-03-13 08:22 -0700
  Re: Find the oldest files without using ls -tr Janis Papanagnou <janis_papanagnou@hotmail.com> - 2012-03-13 18:23 +0100
    Re: Find the oldest files without using ls -tr Ivan Shmakov <oneingray@gmail.com> - 2012-03-14 12:31 +0700
      Re: Find the oldest files without using ls -tr Paul Branon <paulbranon@googlemail.com> - 2012-03-14 08:28 -0700
        Re: Find the oldest files without using ls -tr Ivan Shmakov <oneingray@gmail.com> - 2012-03-14 22:43 +0700
          Re: Find the oldest files without using ls -tr Ben Morrow <ben@morrow.me.uk> - 2012-03-14 18:05 +0000
            Re: Find the oldest files without using ls -tr Sven Mascheck <mascheck@email.invalid> - 2012-03-14 18:31 +0000
              Re: Find the oldest files without using ls -tr Stephane Chazelas <stephane_chazelas@yahoo.fr> - 2012-03-14 19:01 +0000
                Re: Find the oldest files without using ls -tr Ivan Shmakov <oneingray@gmail.com> - 2012-03-15 10:41 +0700
                Re: Find the oldest files without using ls -tr Stephane Chazelas <stephane_chazelas@yahoo.fr> - 2012-03-15 08:13 +0000
                Re: Find the oldest files without using ls -tr Ivan Shmakov <oneingray@gmail.com> - 2012-03-16 10:24 +0700
                Re: Find the oldest files without using ls -tr Sven Mascheck <mascheck@email.invalid> - 2012-03-15 19:54 +0000
              Re: Find the oldest files without using ls -tr Ben Morrow <ben@morrow.me.uk> - 2012-03-14 19:59 +0000
                Re: Find the oldest files without using ls -tr Janis Papanagnou <janis_papanagnou@hotmail.com> - 2012-03-15 00:16 +0100
                Re: Find the oldest files without using ls -tr Ben Morrow <ben@morrow.me.uk> - 2012-03-15 02:12 +0000
                Re: Find the oldest files without using ls -tr Janis Papanagnou <janis_papanagnou@hotmail.com> - 2012-03-15 09:42 +0100
                Re: Find the oldest files without using ls -tr Ben Morrow <ben@morrow.me.uk> - 2012-03-15 10:56 +0000
                Re: Find the oldest files without using ls -tr tmcd@panix.com (Tim McDaniel) - 2012-03-15 15:46 +0000
                Re: Find the oldest files without using ls -tr Ben Morrow <ben@morrow.me.uk> - 2012-03-15 16:49 +0000
                Re: Find the oldest files without using ls -tr tmcd@panix.com (Tim McDaniel) - 2012-03-15 19:06 +0000
                Re: Find the oldest files without using ls -tr Casper H.S. Dik <Casper.Dik@OrSPaMcle.COM> - 2012-03-15 17:13 +0000
  Re: Find the oldest files without using ls -tr Stephane Chazelas <stephane_chazelas@yahoo.fr> - 2012-03-13 17:40 +0000

csiph-web