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 |