From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,f4ff0b364602a2dc X-Google-Attributes: gidfee84,public From: "Yong S. Yi" Subject: Re: Listing Directories (without files!) Date: 2000/03/21 Message-ID: <38D6DDC1.A86D96D@taco.async.org>#1/1 X-Deja-AN: 600213910 Content-Transfer-Encoding: 7bit References: <38D679CE.5FDF2532@bigfoot.com> <38D68B81.4DFD654D@merkantildata.no> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 953605572 168.191.92.152 (Mon, 20 Mar 2000 18:26:12 PST) Organization: Async MIME-Version: 1.0 Reply-To: ysyi@async.org NNTP-Posting-Date: Mon, 20 Mar 2000 18:26:12 PST Newsgroups: comp.unix.osf.osf1 Knut Helleb^x wrote: > I've always been doing ls -ld *|grep '^d' with success. Think this is > faster than find if you're only wanting to investigate the current > directory. You could also do a find -prune .... where prune makes the > find command not descending into subdirectories (if I remember right). Why `ls -ld *|grep ...`? Why not `ls -l|grep ...`? Even though the two would do the same thing (minus the 'total' difference with `ls -l` vs `ls -ld *`), a directory with lots of files (which includes 50,000) wouldn't work quite right with this, AFAIK. The shell (depending on how your system is configured) would have to expand the '*', and complain that there are too many arguments. Try it, you'll see. If that doesn't bother you enough, simply the fact that the shell would have to expand the '*' would be another step, hence taking longer. Why? When you use '*', it would mean that the shell would have to read the directory once to expand it. Then ls would have to do it again, etc. So the fastest way? Code something yourself. -y. -- Yong S. Yi KeyID 1024/8B4FF151 http://www.async.org/~ysyi/ PGP Key Fingerprint = 3A 65 AE 82 07 2A EF 73 0B 84 67 5D 1D 96 9F 8D Enriched, VCard, and HTML messages > /dev/null