[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to sort files in a directory?



Rodolfo Medina wrote:

>> I want to sort all files with, say, .txt extension that are in the directory
>> `/path/to/dir' and all its subdirectories, and I want to perform this search
>> starting from the directory itself: how can I do that?
>>
>> I didn't manage with `find'.
>>
>> Thanks for any suggestion
>> Rodolfo



On Wed, Feb 27, 2008 at 08:14:06PM +0000, Rodolfo Medina wrote:

>> Thanks to all who replied.  It seems that for my purposes this works:
>> 
>>  $ cd /path/to/dir
>>  $ ls *.txt */*.txt | sort 




Tzafrir Cohen <tzafrir@cohens.org.il> writes:

> Huh?
>
> That is not what you asked for. It does not trim the directory names.
> And sorts by the full path as well.
>
> Boo!



I didn't say I wanted the directory names also sorted.

Yes, the full path was not what I wanted, but then I found out that this was
what I actually needed.

Rodolfo


Reply to: