Gentoo Archives: gentoo-user

From: Joseph <syscon780@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] look for a file type + sort
Date: Fri, 13 Sep 2013 05:11:45
Message-Id: 20130913051148.GB4586@syscon7.inet
In Reply to: Re: [gentoo-user] look for a file type + sort by "Canek Peláez Valdés"
1 On 09/13/13 00:04, Canek Peláez Valdés wrote:
2 >On Thu, Sep 12, 2013 at 11:58 PM, Canek Peláez Valdés <caneko@×××××.com> wrote:
3 >> On Thu, Sep 12, 2013 at 11:48 PM, Joseph <syscon780@×××××.com> wrote:
4 >>> I want to list recursively certain type of files eg. *.pdf but I want to
5 >>> display: date, path and newest file first.
6 >>>
7 >>> What is the easiest way of doing it?
8 >>
9 >> ls -l --sort=time "$(find /path -iname "*.pdf")"
10 >>
11 >> If there are no spaces in the filenames/directories, you can drop the
12 >> quotes from $().
13 >
14 >Sorry, it doesn't work with spaces even with the quotes; if you don't
15 >have spaces in the directories/filenames, do
16 >
17 >ls -l --sort=time $(find /path -iname "*.pdf")
18 >
19 >If you have spaces, you need to set/restore IFS:
20 >
21 >S=${IFS}; IFS=$'\n'; ls -l --sort=time $(find . -iname "*.pdf"); IFS=${S}
22 >
23 >Regards.
24 >--
25 >Canek Peláez Valdés
26 >Posgrado en Ciencia e Ingeniería de la Computación
27 >Universidad Nacional Autónoma de México
28
29 Hm, I've tried:
30 ls -l --sort=time $(find /home/joseph -iname "*.jpg")
31
32 got:
33 ls: invalid option -- '/'
34
35 --
36 Joseph

Replies

Subject Author
Re: [gentoo-user] look for a file type + sort "Canek Peláez Valdés" <caneko@×××××.com>