in reply to number of files in current directory - one liner
However, readdir() requires that you either chdir() or prepend the path. So you would have to do something like this: perl -le'$d=pop;opendir(D,$d)||die$!.$/;print~~grep{-f"$d/$_"}readdir D' dir
Or for just the current dir: perl -le'opendir D,".";print~~grep{-f}readdir D'
--
John.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: number of files in directory - one liner
by particle (Vicar) on Mar 27, 2002 at 16:38 UTC |