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 |