Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] look for a file type + sort Joseph <syscon780@×××××.com>