Re: question about ls

2018-10-03 Thread Greg Wooledge
On Wed, Oct 03, 2018 at 12:01:02PM +, Virgo Pärna wrote: > On Thu, 27 Sep 2018 09:14:00 -0400, Greg Wooledge wrote: > > But also note that using ls -l gives a completely wrong answer. > > > > wooledg:~$ mkdir /tmp/x && cd "$_" > > wooledg:/tmp/x$ touch $'this\nis\none\nfile' > > wooledg:/tmp/x

Re: question about ls

2018-10-03 Thread Virgo Pärna
On Thu, 27 Sep 2018 09:14:00 -0400, Greg Wooledge wrote: > But also note that using ls -l gives a completely wrong answer. > > wooledg:~$ mkdir /tmp/x && cd "$_" > wooledg:/tmp/x$ touch $'this\nis\none\nfile' > wooledg:/tmp/x$ ls -l | wc -l > 5 > What about 'ls -1b | wc -l'? -- Virgo Pä

Re: question about ls

2018-09-28 Thread Richard Hector
On 29/09/18 12:21 AM, Greg Wooledge wrote: > On Fri, Sep 28, 2018 at 09:06:59AM +0200, Ionel Mugurel Ciobîcă wrote: >> On 28-09-2018, at 17h 52'07", Richard Hector wrote about "Re: question about >> ls" >>> Eww. Tab completion also gets screwed u

Re: question about ls

2018-09-28 Thread Greg Wooledge
On Fri, Sep 28, 2018 at 09:06:59AM +0200, Ionel Mugurel Ciobîcă wrote: > On 28-09-2018, at 17h 52'07", Richard Hector wrote about "Re: question about > ls" > > Eww. Tab completion also gets screwed up by this: > > > > richard@zircon:~/test$ rm >

Re: question about ls

2018-09-28 Thread Michael Stone
On Fri, Sep 28, 2018 at 08:58:05AM +0200, to...@tuxteam.de wrote: ls should be considered a user interface, not an API. One should strive to minimize these differences, though. This is, of course, just my opinion, but you can pry... (you know the rest ;-) Sure you can--you use find. There are

Re: question about ls

2018-09-28 Thread Ionel Mugurel Ciobîcă
On 28-09-2018, at 17h 52'07", Richard Hector wrote about "Re: question about ls" > > Eww. Tab completion also gets screwed up by this: > > richard@zircon:~/test$ rm > file isone this > > .. but you can't actually complete from any of thos

Re: question about ls

2018-09-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Sep 27, 2018 at 11:03:29AM -0400, Michael Stone wrote: [...] > ls should be considered a user interface, not an API. One should strive to minimize these differences, though. This is, of course, just my opinion, but you can pry... (you know t

Re: question about ls

2018-09-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Sep 27, 2018 at 09:59:58AM -0400, Greg Wooledge wrote: > On Thu, Sep 27, 2018 at 08:53:28AM -0500, David Wright wrote: > > On Thu 27 Sep 2018 at 07:55:56 (-0500), Kent West wrote: > > > westk@westkbox:/opt$ ls -la | wc > > > 7 56

Re: question about ls

2018-09-27 Thread Richard Hector
On 28/09/18 1:14 AM, Greg Wooledge wrote: > On Thu, Sep 27, 2018 at 07:55:56AM -0500, Kent West wrote: >> But also note the difference when using the letter "l" vs the numeral "1": >> >> westk@westkbox:/opt$ ls -la | wc >> 7 56 321 >> westk@westkbox:/opt$ ls -1a | wc >> 6 6

Re: question about ls

2018-09-27 Thread Greg Wooledge
On Thu, Sep 27, 2018 at 10:57:56AM -0400, Gene Heskett wrote: > On Thursday 27 September 2018 08:31:27 Greg Wooledge wrote: > > > On Tue, Sep 25, 2018 at 10:27:03PM +, Long Wind wrote: > > > can ls show number of items in a folder?Thanks! > > > > https://mywiki.wooledge.org/BashFAQ/004 > > An

Re: question about ls

2018-09-27 Thread Michael Stone
On Thu, Sep 27, 2018 at 09:59:58AM -0400, Greg Wooledge wrote: All of the above give the wrong answers when filenames contain newlines. Any solution that involves printing the filenames to a stream and then trying to parse that stream to guess how many filenames are in the stream is a non-starter

Re: question about ls

2018-09-27 Thread Gene Heskett
On Thursday 27 September 2018 08:31:27 Greg Wooledge wrote: > On Tue, Sep 25, 2018 at 10:27:03PM +, 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 ask

Re: question about ls

2018-09-27 Thread David Wright
On Thu 27 Sep 2018 at 09:59:58 (-0400), Greg Wooledge wrote: > On Thu, Sep 27, 2018 at 08:53:28AM -0500, David Wright wrote: > > On Thu 27 Sep 2018 at 07:55:56 (-0500), Kent West wrote: > > > westk@westkbox:/opt$ ls -la | wc > > > 7 56 321 > > > westk@westkbox:/opt$ ls -1a | wc > > >

Re: question about ls

2018-09-27 Thread Greg Wooledge
On Thu, Sep 27, 2018 at 08:53:28AM -0500, David Wright wrote: > On Thu 27 Sep 2018 at 07:55:56 (-0500), Kent West wrote: > > westk@westkbox:/opt$ ls -la | wc > > 7 56 321 > > westk@westkbox:/opt$ ls -1a | wc > > 6 6 54 > > But do use 1A, not 1a, if you want to know ho

Re: question about ls

2018-09-27 Thread David Wright
On Thu 27 Sep 2018 at 07:55:56 (-0500), Kent West wrote: > On Tue, Sep 25, 2018 at 6:14 PM Ben Caradoc-Davies wrote: > > > On 26/09/2018 10:55, Long Wind wrote: > > > sorry! you're right. > > > after checking ls manual, i find ls has option -1 > > > > Note also that ls will behave like it has the

Re: question about ls

2018-09-27 Thread Greg Wooledge
On Thu, Sep 27, 2018 at 07:55:56AM -0500, Kent West wrote: > But also note the difference when using the letter "l" vs the numeral "1": > > westk@westkbox:/opt$ ls -la | wc > 7 56 321 > westk@westkbox:/opt$ ls -1a | wc > 6 6 54 But also note that using ls -l gives a

Re: question about ls

2018-09-27 Thread Kent West
On Tue, Sep 25, 2018 at 6:14 PM Ben Caradoc-Davies wrote: > On 26/09/2018 10:55, Long Wind wrote: > > sorry! you're right. > > after checking ls manual, i find ls has option -1 > > Note also that ls will behave like it has the "-1" option if its output > is piped to another command, even without

Re: question about ls

2018-09-27 Thread Greg Wooledge
On Tue, Sep 25, 2018 at 10:27:03PM +, Long Wind wrote: > can ls show number of items in a folder?Thanks! https://mywiki.wooledge.org/BashFAQ/004

Re: question about ls

2018-09-25 Thread Ben Caradoc-Davies
On 26/09/2018 10:55, Long Wind wrote: sorry! you're right. after checking ls manual, i find ls has option -1 Note also that ls will behave like it has the "-1" option if its output is piped to another command, even without this option. I like to use the "-1" option even in this case because i

Re: question about ls

2018-09-25 Thread Ben Caradoc-Davies
On 26/09/2018 10:27, Long Wind wrote: can ls show number of items in a folder?Thanks! I use: ls -1 | wc -l To include items whose names start with ".", add the "a" or "A" argument to ls ("man ls" for details). For more advanced searches (recursive or filtering on file type), I use find.

question about ls

2018-09-25 Thread Long Wind
can ls show number of items in a folder?Thanks! On Wednesday, September 26, 2018 4:51 AM, Gary Dale wrote: For the last few days, some Scribus documents I work with have stopped accepting PDF files within image frames. Prior to this, they would display a preview. Now new image frames