Re: ls -l|head seems to look at all files in directory
From:
Pádraig Brady
Subject:
Re: ls -l|head seems to look at all files in directory
Date:
Mon, 25 May 2009 15:19:00 +0100
User-agent:
Thunderbird 2.0.0.6 (X11/20071008)
Kamil Dudka wrote:
> On Monday 25 of May 2009 15:43:50 Reuben Thomas wrote:
>> Hi,
>>
>> If I do "ls -l |head" on a directory with many files in it, it takes a long
>> time to complete, suggesting that it has read the entire directory. Since
>> no sorting is involved, why has it done this?
>
> If you want to turn off sorting, try the -U option.
Also the total size of the directory is printed when -l is specified,
so you'll probably need to remove that option.
cheers,
Pádraig.