Re: question about ls
- Date: Thu, 27 Sep 2018 10:57:56 -0400
- From: Gene Heskett <gheskett@xxxxxxxxxxx>
- Subject: Re: question about ls
On Thursday 27 September 2018 08:31:27 Greg Wooledge wrote:
> On Tue, Sep 25, 2018 at 10:27:03PM +0000, Long Wind wrote:
> > can ls show number of items in a folder?Thanks!
And finally, an "ls -l|wc -l" from the cli gives the answer to the
question asked. Change the -l to -lR if there are subdirs in that
directory. Or if you want to know how many .jpg pix, use
"ls -l *.jpg|wc -l". The list goes on
The wiki is educational about how to make bash dance to your tune, but
for this I'd druther use its default behavior.
bash can be and is a very powerfull scripting language, I've ported
nearly everything I ever wrote in ARrexx, the universal do anything
language for the Amiga from 25 years ago, to bash, and they've worked at
least as good as on the Amiga.
Cheers, Gene Heskett
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>