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!
>
> https://mywiki.wooledge.org/BashFAQ/004
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>
Reply to: